template <class Name, class Exp, class Body>
struct letrec_c
{
// unspecified
};
The same as letrec
, but Exp
and Body
are angle-bracket expressions and not syntaxes.
#include <mpllibs/metamonad/letrec_c.hpp>
For any n
, e
and b
classes
letrec_c<n, e, b>::type
is equivalent to
letrec<n, syntax<e>, syntax<b>>::type
using boost::mpl::times;
using boost::mpl::plus;
using boost::mpl::minus;
using boost::mpl::int_;
using boost::mpl::equal_to;
struct fact_;
typedef var<fact_> fact;
typedef
eval_syntax<
letrec_c<
fact,
lambda_c<
n,
if_<
equal_to<n, int_<0>>,
int_<1>,
lazy<times<apply<fact, minus<n, int_<1>>>, n>>
>
>,
lazy<apply<fact, int_<3>>>
>
>::type
fact_3;
Copyright Abel Sinkovics (abel at elte dot hu) 2011. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt