Re: [boost] [mpl] Metafunction terminology - revival?

----- Mensaje original ----- De: David Bergman <David.Bergman@bergmangupta.com> Fecha: Lunes, Julio 24, 2006 8:08 pm Asunto: Re: [boost] [mpl] Metafunction terminology - revival?
Ok, two interpretations:
1. (Mine) What the MPL documentation calls a "lambda expression" (as of the refered page [http://boost.org/libs/mpl/doc/refmanual/lambda-expression.html]) is either "placeholder expression" or meta function classes *generated* by the application of mpl::lambda, i.e., *just* the meta function classes generated in that specific way.
2. (Yours) All metafunction classes are "lambda expressions."
I've reread the referred page, and all I can take it to define is: a lambda expression is a metafunction class or a placeholder expression. Whether this is what the authors actually *meant* is debatable, of course.
I am admittedly biased, but I think my interpretation is the most sound one ;-) The reason for that is that I would hesitate to call an explicitly defined metafunction class, such as
struct MyMeta { template<class T> apply { typedef int type; } };
a lambda expression.
Personally, I favor your interpretation of what lambda expressions and metafunction classes should be defined to be, I was only sticking to the reference. <pedantic digression> Just to play devil's advocate, what gives a lambda expression its essence, at least in mathematical lambda calculus, is not the presence of place holders, but the ability to apply to actual arguments, and this ability can be coded with mechanisms other than placeholders. For instance, in combinatorial calculus (http://en.wikipedia.org/wiki/Combinatory_logic), all lambda expressions can be given equivalent formulations using only the combinators S and K, thus effectively avoiding the use of placeholders altogether. It could be an interesting investigation project to determine whether combinatorial methods can be modelled into the metaprogramming framework of C++ just the way lambda expressions have been. </pedantic digression> [...]
/David
Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

Joaquin wrote: [snip]
I've reread the referred page, and all I can take it to define is: a lambda expression is a metafunction class or a placeholder expression. Whether this is what the authors actually *meant* is debatable, of course.
What I think it literally means is that a lambda expression is either a metafunction class or a placeholder expression, much like a woman is either nice or mean. This does NOT imply that all nice people are women ;-) So, I think even the literal reading of the refered sentence(s) leaves room for non-lambda-expressive metafunction classes... [snip]
Personally, I favor your interpretation of what lambda expressions and metafunction classes should be defined to be, I was only sticking to the reference.
<pedantic digression> Just to play devil's advocate, what gives a lambda expression its essence, at least in mathematical lambda calculus, is not the presence of place holders, but the ability to apply to actual arguments,
No, that is not true, actually, since that essence of applicability is best captured by the notion of "function." A lambda expression is a special type of function (or, rather, lambda expressions are isomorphic to a set of functions...) This is analogous to the MPL discussion we have, where I find that "metafunctors" captures that notion better than the (more specific) "lambda expression."
and this ability can be coded with mechanisms other than placeholders. For instance, in combinatorial calculus (http://en.wikipedia.org/wiki/Combinatory_logic), all lambda expressions can be given equivalent formulations using only the combinators S and K, thus effectively avoiding the use of placeholders altogether.
Yes, but they all share the common element of abstracting a parameter into a (concrete) expression, even though the parameters are not symbolically present in the (super) combinatorial systems.
It could be an interesting investigation project to determine whether combinatorial methods can be modelled into the metaprogramming framework of C++ just the way lambda expressions have been.
Yes, it could. In some sense, the mechanics of function adapters in C++ mirrors that parameter-less and beautiful world to some extent.
</pedantic digression>
/David
participants (2)
-
David Bergman
-
JOAQUIN LOPEZ MU?Z