|
Boost : |
From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-12-13 16:30:49
----- Original Message -----
From: "Mat Marcus" <mmarcus_at_[hidden]>
> MPL includes macros such as BOOST_MPL_MAKE_F_X(MyMFQuoted, MyMF). As an
> implementation detail, this macro wraps a metafunction, MyMF, inside of a
> struct, MyMFQuoted. In a recent post I found it convenient label this
> wrapping process "Quoting" after common lisp's #'. If one pursues this
> analogy than it might make sense to change the name of 'apply' to 'eval'
for
> symmetry. If we also change the macro name to BOOST_MPL_QUOTE_F_X then
here
> is one before/after scenario:
<snip>
> Another alternative would be to use the MetaFunctor/call concept (aka
> function class):
>
> template <class T>
> struct MyMF {
> typedef /*...*/ type;
> };
>
> BOOST_MPL_METAFUNCTOR_F_X(MyMetaFunctor, MyMetaFunction);
>
> template <class TList, class MetaFunctor>
> struct AnAlgorithm {
> /* ... */
> typedef typename
> QuotedMF::template call<TList>::type temp; // call?
----^^^^^^^^ I presume you mean MetaFunctor here?
> /* ... */
> };
>
> In any case it seems to me that apply is somewhat ambiguous. Thoughts?
I think call is the best choice. I think any mention of "quoting" a function
is going to make the library less accessible. We need to appeal to as many
familiar idioms as possible, since metaprogramming is such a mind-shift to
begin with.
-Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk