Subject: Re: [boost] De Bruijn Bind (alternate bind syntax) Interest?
From: Larry Evans (cppljevans_at_[hidden])
Date: 2010-09-05 19:56:31
On 09/04/10 13:54, David Sankel wrote:
> On Sat, Sep 4, 2010 at 10:55 AM, Larry Evans <cppljevans_at_[hidden]>wrote:
>> On 09/04/10 08:24, Larry Evans wrote:
>>> The attached illustrates the difficulty I was having with
>>> mpl::apply. Maybe the apply_apply typedef would be a good
>>> use-case for De Bruijn's method.
>> Attached is much simplified code that still illustrates problem.
>> Compile errors included:
> Thanks for the example. If a De Bruijn indices were used, this would look
> typedef< app< lam< app< op, _1_1 > >
> , int_<1>
> >::type apply_apply;
> I think this is a valid example of the needlessly cryptic bind/lambda
> semantics that are widespread.
I tried translating the above code back to the, let's call at the
type 'universe' as opposed to the value 'universe'. I'm using
universe because that's a term used by nuprl:
to describe hierarchy of types and also because the only other name I
could think of was domain, and that's used by proto and for other
reasons. Another candidate was 'kind':
but I thought of 'universe' first and it seemed more general.
However, compiling my first try( the attached) gives:
> make -f my-make.mk
> /home/evansl/download/gcc/4.5.1-release/install/bin/g++ -Iinclude -I/home/evansl/prog_dev/boost-svn/ro/boost_1_44_0 -std=gnu++0x src/apply_apply.cpp src/test.cpp -o bin/apply_apply.exe
> src/apply_apply.cpp: In function 'int main()':
> src/apply_apply.cpp:63:28: error: cannot convert 'App<int (*)(int), boost::fusion::vector1<int> >' to 'int' in initialization
> make: *** [bin/apply_apply.exe] Error 1
What am I doing wrong?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk