
Maurizio Vitale wrote:
Eric Niebler <eric@boost-consulting.com> writes:
No, proto::_ is a placeholder. And proto::not_<> can logically negate any grammar, not just proto::_.
FWIW I kind of like proto::_. It gives me warm memories of ML and Haskell patterns in the land of...brrr...I digress.
But I'd appreciate if you could elaborate on why you see it as a placeholder.
Technically I guess it is: it certainly takes space in the parse tree, but I tend to think about placeholders as things that mark a spot that I can then reference from somewhere else (and from here stems my confusion on transformations from another thread. This and the fact that mpl lambda placeholders are mentioned in the documentation).
I suppose I hadn't thought very hard about what the difference between the term "placeholder" and "wildcard" might be.
Now I see proto::_ more like a wildcard pattern that matches anything but doesn't have additional meaning (or features for the user).
OK.
Is there anything I'm missing about proto::_ ?
No, I think you got it. Proto::_ is a wildcard pattern that matches anything. In the sense that it is never /substituted/ with anything, it is not a placeholder. I misspoke. I could rename proto::_ to proto::anything, and that would be more evocative of its meaning, but I still like proto::_ better. -- Eric Niebler Boost Consulting www.boost-consulting.com