Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2007-06-14 19:00:27

Maurizio Vitale wrote:
> On Jun 14, 2007, at 12:57 PM, Eric Niebler wrote:
>> Maurizio Vitale wrote:
>>> if you could find a way to completely hide the fact that a
>>> terminal is
>>> a unary_expr from the user I think it would be much cleaner for
>>> a boost::proto release.
>> I'll give the issue some thought. One possibility is shoehorn into
>> proto
>> the concept of a nullary expression, which is what terminals should
>> rightly be. Of course, what is there already works, so IMO there are
>> bigger fish to fry first.
> I think "usability" considerations play a big role in a library
> acceptance.

I'm willing to bet that you have been taking advantage of the usability
that terminals-as-unary-expressions brings, without even noticing it.

Q: How do you get the argument of a unary expression?
A: proto::arg().

Q: How do you get the value out of a terminal?
A: proto::arg().

This works because terminals have one "argument", just as unary
expressions do. I like this. I don't want to have to use a separate
function to extract the argument from a terminal. But if I draw a crisp
line between terminals and unary expressions, I might have to.
Otherwise, the line stays blurry.

I really don't think it's as cut-and-dry as you make it. I'll think
about it.

Eric Niebler
Boost Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at