Re: [Boost-docs] [Gaea] Named optional attributes

Subject: Re: [Boost-docs] [Gaea] Named optional attributes
From: Joel de Guzman (joel_at_[hidden])
Date: 2011-11-06 23:56:02


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

This archive was generated by hypermail 2.1.7 : 2017-11-11 08:50:41 UTC