From: Eric Niebler (eric_at_[hidden])
Date: 2008-03-10 13:37:55
Steven Watanabe wrote:
> Markus Werle wrote:
>> "User" is a very ambiguous word for proto.
>> Actually most "users" of proto will be "library writers"
>> seeking to boost (sic!) their productivity.
>> So even the nitty-gritty details matter.
>> I reject any "do-not-mind-it's-only-deep-inside" arguments
>> here. Everybody writing a compile time algorithm acting on
>> proto structures for whatever reason will be affected by this
>> "detail" and the implications might only become clear later,
>> when somebody is in need to do some compile-time-magic.
>> From Daixtrose I know that the number of template arguments
>> can be reciprocal to readability, maintainability and extensibility.
The expr<> type doesn't show up in code, unless you're doing something a
little weird. Can you say why you think an extra defaulted template
parameter on a type which doesn't show up in user code affects
readability, maintainability or extensibility?
> You can (and should) write expr<terminal_tag, args0<int> > rather
> than expr<terminal_tag, args0<int>, 0>.
I agree it's worth considering these issues, but have a look at Proto's
examples. The expr<> type is not mentioned once in any of them. The
advanced features of Proto make stating expression types in code
> Library writers are not
> somehow special in this respect. When I said "user" I meant anyone who
> is not the author or maintainer of proto.The only problems that I can
> see are that mpl::apply<expr<mpl::_, mpl::_>, terminal_tag, args0<int> >
> won't work and that mpl::quote2<expr> will fail.
That's a legitimate concern. How important do you consider these use cases?
-- Eric Niebler Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk