Welcome to the Emacs shell ~/prog_dev/boost-svn/ro/sandbox/rw/variadic_templates/sandbox/deBruijn/clone $ hg pull pulling from http://bitbucket.org/camior/de-bruijn-bind searching for changes no changes found ~/prog_dev/boost-svn/ro/sandbox/rw/variadic_templates/sandbox/deBruijn/clone $ hg update 0 files updated, 0 files merged, 0 files removed, 0 files unresolved ~/prog_dev/boost-svn/ro/sandbox/rw/variadic_templates/sandbox/deBruijn/clone $ cd src ~/prog_dev/boost-svn/ro/sandbox/rw/variadic_templates/sandbox/deBruijn/clone/src $ make /home/evansl/download/gcc/4.5.1-release/install/bin/g++ -I../include -I/home/evansl/prog_dev/boost-svn/ro/boost_1_44_0 -std=gnu++0x ./wiki.cpp -o ../bin/wiki.exe ./wiki.cpp: In function 'int wiki::test()': ./wiki.cpp:96:11: error: no match for call to '(const App0) (, const arg<2, 1>&, Abs<1, App, boost::fusion::vector1 > > >)' ./wiki.cpp:98:5: error: expected ')' before ';' token ./wiki.cpp:98:5: error: unable to deduce 'auto' from '' ./wiki.cpp:101:33: error: 'lam_y_zx_lam_u_ux' was not declared in this scope ./wiki.cpp:101:33: error: unable to deduce 'auto' from '' make: *** [../bin/wiki.exe] Error 1 ~/prog_dev/boost-svn/ro/sandbox/rw/variadic_templates/sandbox/deBruijn/clone/src $ cat wiki.cpp //Purpose: // Test the wiki problem: // // http://en.wikipedia.org/wiki/De_Bruijn_index // // more specifically, this term: // // (\x. \y. z x (\u. u x)) (\x. w x) // #include #include "DeBruijnBind.hpp" #if 1 namespace wiki /**@brief * Problem found in [wiki]: * http://en.wikipedia.org/wiki/De_Bruijn_index * just after: * "following term written in usual notation" * that term being: * (\x. \y. z x (\u. u x)) (\x. w x) * which should beta-reduce to: * \y. z (\x. w x) (\u. u (\x. w x)) */ { int w ( int x ) { return x; }; template < typename F > int z ( int x , F f ) { return f(x); }; int test(void) { auto lamb_wx = lam<1> //lam[1]:\x ( app ( w , _1_1 //x ) )//(\x.w x) ; auto eval_lamb_wx_99 = lamb_wx(99) ; std::cout <<"eval_lamb_wx_99=" < //lam[3]:\u ( app ( _1_1 //u, bound by lam[3]. , 99 )//u 99 ) ; auto eval_lam_u_u99_w = lam_u_u99(w) ; std::cout <<"eval_lam_u_u99_w=" < //lam[2]:\y ( app ( z , _2_1 //x , lam<1> //lam[3]:\u ( app ( _1_1 //u, bound by lam[3]. , _3_1 //x, bound by lam[1]. )//u x )//\u.u x )//z x (\u.u x) )//\y.z x (\u.u x) ; auto eval_lam_y_zx_lam_u_ux = lam_y_zx_lam_u_ux("unused") ; std::cout <<"eval_lam_y_zx_lam_u_ux=" < //lam[1]:\x ( lam<1> //lam[2]:\y ( app ( z , _2_1 //x , lam<1> //lam[3]:\u ( app ( _1_1 //u, bound by lam[3]. , _3_1 //x, bound by lam[1]. )//u x )//\u.u x )//z x (\u.u x) )//\y.z x (\u.u x) )//(\x.\y.z x (\u.u x)) ; auto x_arg = lam<1> //lam[1]:\x ( app ( w , _1_1 //x, bound by lam[1]. ) ) //(\x. w x) ; auto eval_lamb_x_lamb_y_zx_lamb_u_ux_x_arg = app ( lamb_x_lamb_y_zx_lamb_u_ux , x_arg ) ; std::cout <<"eval_lamb_x_lamb_y_zx_lamb_u_ux_x_argl=" <