ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Structuring topics
       [not found] <mailman.629.1271656654.4277.ntg-context@ntg.nl>
@ 2010-04-19 17:08 ` Vyatcheslav Yatskovsky
  2010-04-19 18:29   ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Vyatcheslav Yatskovsky @ 2010-04-19 17:08 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Structuring topics
  2010-04-19 17:08 ` Structuring topics Vyatcheslav Yatskovsky
@ 2010-04-19 18:29   ` Wolfgang Schuster
  2010-04-19 19:15     ` \define... (was: Re: Structuring topics) Peter Münster
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2010-04-19 18:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* \define... (was: Re: Structuring topics)
  2010-04-19 18:29   ` Wolfgang Schuster
@ 2010-04-19 19:15     ` Peter Münster
  2010-04-20  3:41       ` \define Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Münster @ 2010-04-19 19:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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/


___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: \define...
  2010-04-19 19:15     ` \define... (was: Re: Structuring topics) Peter Münster
@ 2010-04-20  3:41       ` Wolfgang Schuster
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Schuster @ 2010-04-20  3:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: \define...
       [not found] <mailman.0.1271757601.23007.ntg-context@ntg.nl>
@ 2010-04-20 13:38 ` Vyatcheslav Yatskovsky
  0 siblings, 0 replies; 5+ messages in thread
From: Vyatcheslav Yatskovsky @ 2010-04-20 13:38 UTC (permalink / raw)
  To: ntg-context


"Curiouser and curiouser!" cried Alice.
:)

>
> 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)


-- 
Best Regards,
Vyatcheslav Yatskovsky
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-04-20 13:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.629.1271656654.4277.ntg-context@ntg.nl>
2010-04-19 17:08 ` Structuring topics Vyatcheslav Yatskovsky
2010-04-19 18:29   ` Wolfgang Schuster
2010-04-19 19:15     ` \define... (was: Re: Structuring topics) Peter Münster
2010-04-20  3:41       ` \define Wolfgang Schuster
     [not found] <mailman.0.1271757601.23007.ntg-context@ntg.nl>
2010-04-20 13:38 ` \define Vyatcheslav Yatskovsky

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).