Subject: Re: [Boost-docs] [Gaea] Named optional attributes
From: Joel de Guzman (joel_at_[hidden])
Date: 2011-11-04 20:29:42
On 11/2/2011 7:29 AM, Matias Capeletto wrote:
> One thing that bugs me about the current definition of if
> is that doesn't work like other templates because you can call it with
> two or three parameters. To be a real template it should be defined in
> the specs as [decl [if cond . branchs]]. But maybe it is somewhat
> nitpicking :)
I'm not sure I follow. The declaration of if is:
[decl [if cond then else]]
You need exactly 3 arguments. You can't have 2.
> Nice... I was waiting to see what you were thinking about this.
> I do not know if I fully understand how it supposed to work. These
> variables are not intended to be used as arguments of other templates,
> but as a way to create some kind of global variables accessibly by all
> other templates?
> [def [unfold . things] [fold [things][rcat]]]
> [var footnotes-list ]
> [def [section name . blocks]
> [set footnotes-list ]
> [unfold [blocks]]
> [unfold [footnotes-list]]
> [def [footnote text]
> [def [footnote-id] [size [footnotes-list]]]
> <footnoteref id=[footnote-id]/>
> [set footnotes-list [append [footnotes-list] [[footnote-id] :: [text]]]
> It feels a little bit strange, but maybe is just the first impression.
> Do you have any other use cases?
TBH, I'm not quite happy with it either. The language is purely
functional apart from that. There should be a way to do above using
a purely FP way, but it's not as easy.
As always, suggestions welcome.
-- Joel de Guzman http://www.boostpro.com http://boost-spirit.com
This archive was generated by hypermail 2.1.7 : 2017-11-11 08:50:41 UTC