Subject: | |
From: | |
Reply To: | |
Date: | Mon, 31 Aug 2009 17:04:16 +0930 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
On 28/08/2009, at 10:43 PM, Lars Hellström wrote:
> Well, why use a syntax that needs a separate parser at all?
[...]
> \DeclareTemplate{caption}{lesssimple}{4}{
> \Variable {above-skip} {\l_caption_above_skip}
> \Variable {below-skip} {\l_caption_below_skip}
> \Function {number-format} {2}{\caption_number_format:nn}
> \Function {nonumber-format} {2}{\caption_nonumber_format:nn}
> \Function {single-line-format}{1}{\caption_single_line_format:n}
> \Function {caption-font} {0}{\caption_set_font:}
> \Instance {caption-hj-setup} {hj}{\caption_hj_instance}
> }
>
> The \Variable, \Function, and \Instance commands above need not
> exist in general; they can be locally redefined "within the
> parameter declarations". (Philologically it is not unheard of in
> other languages to have special sets of commands available within
> declaration blocks.) Besides avoiding the overhead of a special
> parser, the above also has the advantage of being more robust by
> virtue of simplicity and adherence to the general language syntax
> and semantics, which tend to have their corner cases better worked
> out than something invented for a special purpose.
Bonus points for the word "philologically" :)
I quite like this approach.
I'm going to be a bit quiet over the next little while, but after that
I may try to put together a "template-alt-alt" along these lines to
see how things turn out.
Thanks,
Will
|
|
|