ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* safe way of writing arguments
@ 2006-08-07 21:43 Jano Kula
  2006-08-08  7:58 ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Jano Kula @ 2006-08-07 21:43 UTC (permalink / raw)


Hi!

Is it safe to leave spare comma at the end of the key=value list or 
other list of arguments?

It is not nice, but when adding/commenting arguments in readable way 
(one per line) it's faster and while experimenting with parameters one 
doesn't have to care about the last comma adding or removing it back and 
forth, for example:

\setuplayout[
grid=yes,
%header=0mm,
footer=7mm,
%footerdistance=10mm,
%cutspace=12mm,
]

or

\setuphead[
chapter,
section,
%subsection,
%subsubsection,
][
textstyle=\ss,
numberstyle=\ss,
]

Thanks.

Jano Kula

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

* Re: safe way of writing arguments
  2006-08-07 21:43 safe way of writing arguments Jano Kula
@ 2006-08-08  7:58 ` Hans Hagen
  2006-08-08 11:16   ` Jano Kula
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2006-08-08  7:58 UTC (permalink / raw)


Jano Kula wrote:
> Hi!
>
> Is it safe to leave spare comma at the end of the key=value list or 
> other list of arguments?
>   
in most cases it is ok
> It is not nice, but when adding/commenting arguments in readable way 
> (one per line) it's faster and while experimenting with parameters one 
> doesn't have to care about the last comma adding or removing it back and 
> forth, for example:
>
> \setuplayout[
> grid=yes,
> %header=0mm,
> footer=7mm,
> %footerdistance=10mm,
> %cutspace=12mm,
> ]
>   
in this case a space after 12mm is not that problematic because layout 
are calculated in vertical mode and the 12 mm is used in assignments
> or
>
> \setuphead[
> chapter,
> section,
> %subsection,
> %subsubsection,
>   
hm, here it can be troublesome unless i catch an empty case (not sure); 
if you run into troubles with such cases report it to the list and we 
can see if we can catch it
> ][
> textstyle=\ss,
> numberstyle=\ss,
> ]
>   
Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

* Re: safe way of writing arguments
  2006-08-08  7:58 ` Hans Hagen
@ 2006-08-08 11:16   ` Jano Kula
  2006-08-08 12:02     ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Jano Kula @ 2006-08-08 11:16 UTC (permalink / raw)


Hans Hagen wrote:
> Jano Kula wrote:
>> Hi!
>>
>> Is it safe to leave spare comma at the end of the key=value list or 
>> other list of arguments?
>>   
> in most cases it is ok
>> It is not nice, but when adding/commenting arguments in readable way 
>> (one per line) it's faster and while experimenting with parameters one 
>> doesn't have to care about the last comma adding or removing it back and 
>> forth, for example:
>>
>> \setuplayout[
>> grid=yes,
>> %header=0mm,
>> footer=7mm,
>> %footerdistance=10mm,
>> %cutspace=12mm,
>> ]
>>   
> in this case a space after 12mm is not that problematic because layout 
> are calculated in vertical mode and the 12 mm is used in assignments
>> or
>>
>> \setuphead[
>> chapter,
>> section,
>> %subsection,
>> %subsubsection,
>>   
> hm, here it can be troublesome unless i catch an empty case (not sure); 
> if you run into troubles with such cases report it to the list and we 
> can see if we can catch it
>> ][
>> textstyle=\ss,
>> numberstyle=\ss,
>> ]
>>   
> Hans 
> 
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
>                                              | www.pragma-pod.nl
> -----------------------------------------------------------------

Thanks,

I've found the example of the different behaviour, though the reason 
isn't the comma, but the space after the command, I think. So even 
writing parameters one-per-line (with space left behind = last one 
without comma or percent sign) can be dangerous.

%\setuphead[chapter][style=\bfd]        % works
%\setuphead[chapter][style={\bfd}]      % works
%\setuphead[chapter][style={\bfd} ]     % doesn't work
%\setuphead[chapter][style={\bfd},]     % works
\starttext
\chapter{Test chapter}
\stoptext

This is not seriuos, I just want to find, how the things work.

Jano

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

* Re: safe way of writing arguments
  2006-08-08 11:16   ` Jano Kula
@ 2006-08-08 12:02     ` Hans Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2006-08-08 12:02 UTC (permalink / raw)


Jano Kula wrote:
> Hans Hagen wrote:
>   
>> Jano Kula wrote:
>>     
>>> Hi!
>>>
>>> Is it safe to leave spare comma at the end of the key=value list or 
>>> other list of arguments?
>>>   
>>>       
>> in most cases it is ok
>>     
>>> It is not nice, but when adding/commenting arguments in readable way 
>>> (one per line) it's faster and while experimenting with parameters one 
>>> doesn't have to care about the last comma adding or removing it back and 
>>> forth, for example:
>>>
>>> \setuplayout[
>>> grid=yes,
>>> %header=0mm,
>>> footer=7mm,
>>> %footerdistance=10mm,
>>> %cutspace=12mm,
>>> ]
>>>   
>>>       
>> in this case a space after 12mm is not that problematic because layout 
>> are calculated in vertical mode and the 12 mm is used in assignments
>>     
>>> or
>>>
>>> \setuphead[
>>> chapter,
>>> section,
>>> %subsection,
>>> %subsubsection,
>>>   
>>>       
>> hm, here it can be troublesome unless i catch an empty case (not sure); 
>> if you run into troubles with such cases report it to the list and we 
>> can see if we can catch it
>>     
>>> ][
>>> textstyle=\ss,
>>> numberstyle=\ss,
>>> ]
>>>   
>>>       
>> Hans 
>>
>> -----------------------------------------------------------------
>>                                           Hans Hagen | PRAGMA ADE
>>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>>      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
>>                                              | www.pragma-pod.nl
>> -----------------------------------------------------------------
>>     
>
> Thanks,
>
> I've found the example of the different behaviour, though the reason 
> isn't the comma, but the space after the command, I think. So even 
> writing parameters one-per-line (with space left behind = last one 
> without comma or percent sign) can be dangerous.
>
> %\setuphead[chapter][style=\bfd]        % works
> %\setuphead[chapter][style={\bfd}]      % works
> %\setuphead[chapter][style={\bfd} ]     % doesn't work
> %\setuphead[chapter][style={\bfd},]     % works
> \starttext
> \chapter{Test chapter}
> \stoptext
>
> This is not seriuos, I just want to find, how the things work.
>   
this is because the value of style is interpreted in its own special 
way; also, in

{xx}<space>

the become part of the value, and {\bfd} is ineffective due to grouping 
then

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

end of thread, other threads:[~2006-08-08 12:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-07 21:43 safe way of writing arguments Jano Kula
2006-08-08  7:58 ` Hans Hagen
2006-08-08 11:16   ` Jano Kula
2006-08-08 12:02     ` Hans Hagen

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