Re: [NTG-context] Structuring topics
Hi Wolfgang,
title=yes, titleleft=, titleright=,
Yeah, thanks! That's the title that makes it! Concerning \define... The answer is too witty for me, so I will leave the wiki page untouched. -- Best Regards, Vyatcheslav Yatskovsky
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
On Mon, Apr 19 2010, Wolfgang Schuster wrote:
\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
Hello Wolfgang, Did you test it? The output is "taco" here on my system: MTXrun | current version: 2010.04.16 21:08 Cheers, Peter -- Contact information: http://pmrb.free.fr/contact/
Am 19.04.10 21:15, schrieb Peter Münster:
On Mon, Apr 19 2010, Wolfgang Schuster wrote:
\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
Hello Wolfgang,
Did you test it? The output is "taco" here on my system: MTXrun | current version: 2010.04.16 21:08
no i didn't test it context has two different versions of \define, there is one in syst-ext.mkii/syst-aux.mkiv which has no parameters but prevents you from overwriting a existing command (there \redefine with allows this) and another one in core-sys.mkii/mkiv which replace the first one and has support for parameters but replace on the other side the old definition (you get only the terminal message) the question is, which behavious is correct, replace the old macro or keep it, in my opinion \define should leave the old definition untouced and \redefine should be used in this case (but we need a version with parameters) Wolfgang
participants (3)
-
Peter Münster
-
Vyatcheslav Yatskovsky
-
Wolfgang Schuster