ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Structuring topics
Date: Mon, 19 Apr 2010 20:29:06 +0200	[thread overview]
Message-ID: <4BCCA0F2.8080802@googlemail.com> (raw)
In-Reply-To: <4BCC8DF2.50006@gmail.com>

Am 19.04.10 19:08, schrieb Vyatcheslav Yatskovsky:
> Concerning \define... The answer is too witty for me, so I will leave 
> the wiki page untouched.

What's the problem with my answer, i described differences between \def 
and \define
and the most important one is point one, i'll show it to you in two examples

1. \def

\starttext
\def\hans{hans}
\def\hans{taco}
\hans
\stoptext

the output of this example is 'taco' because the second \def statement 
overides the first

2. \define

\starttext
\define\hans{hans}
\define\hans{taco}
\stoptext

the output now is 'hans' because \define checks whether a command with 
the name \hans
is already defined, if this isn't true \hans is created with the content 
'hans' while
in the second \define \hans is already available and nothing happens but 
you get
a warning on the terminal

system          : command \hans is already defined


to summary this you can say \def is for developers and \define for users 
but this won't
work in all cases because \define can't create commands with optional 
arguments :(

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  reply	other threads:[~2010-04-19 18:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.629.1271656654.4277.ntg-context@ntg.nl>
2010-04-19 17:08 ` Vyatcheslav Yatskovsky
2010-04-19 18:29   ` Wolfgang Schuster [this message]
2010-04-19 19:15     ` \define... (was: Re: Structuring topics) Peter Münster
2010-04-20  3:41       ` \define Wolfgang Schuster
     [not found] <mailman.639.1271711886.4277.ntg-context@ntg.nl>
2010-04-19 22:20 ` Structuring topics Vyatcheslav Yatskovsky
     [not found] <mailman.623.1271618022.4277.ntg-context@ntg.nl>
2010-04-18 19:36 ` Vyatcheslav Yatskovsky
2010-04-18 19:46   ` Wolfgang Schuster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BCCA0F2.8080802@googlemail.com \
    --to=schuster.wolfgang@googlemail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).