Re: [Gaea] Named optional attributes

Joel de Guzman <[email protected]>
Newsgroups gmane.comp.lib.boost.documentation
Message-ID <[email protected]>
On 11/6/2011 4:15 PM, Dave Abrahams wrote:
>> Is this good or bad? I don't know. Well, scheme and lisp do
>> have side-effects. But, I kinda agree with Terrence Parr:
>> "The fact that StringTemplate does not allow such things
>> as assignments (no side-effects) should make you suspicious
>> of engines that do allow it."
> 
> IMO if you can afford it, it's better to go side-effect-free.
> If you can't afford it, I suggest labeling the name on which the
> side-effect occurs, rather than labeling the function.
> 
>    [decl [append 'x e]]
>    [decl [insert 'x e n]]
>    [decl [reverse 'x]]
>    [decl [join 'x y]]
>    [decl [transform 'x f]]
>    [decl [for-each 'x 'f]]
> 
> You might want to ask the caller to label the arguments that way, too...

Those are very nice suggestions, Dave. Indeed, the side-effect-edness
involves particular arguments, not the functions themselves. Much
like phoenix's var.

Regards,
-- 
Joel de Guzman
http://www.boostpro.com
http://boost-spirit.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.