Subject: Re: [boost] De Bruijn Bind (alternate bind syntax) Interest?
From: David Sankel (camior_at_[hidden])
Date: 2010-09-03 14:30:18
On Fri, Sep 3, 2010 at 1:09 PM, Dave Abrahams <dave_at_[hidden]> wrote:
> Can someone explain to me, in English, what this technique allows me
> to express that I couldn't otherwise?
> Is this just about allowing generic composition of lambdas?
I'll take a stab at this too.
De Bruijn (pronounced like day-brown) bind allows for the declaration of
higher-order (has the possibility of taking functions as arguments and
returning them), polymorphic (compile-time variety), functions as C++
expressions (on the right hand side of the equal sign).
This has overlap with both boost bind, boost lambda, and phoenix. What is
unique to De Bruijn is:
1. There is a direct and simple translation to and from lambda calculus.
bind and lambda cover only a small portion of lambda calculus in comparison
(I don't know about phoenix). So De Bruijn bind can express more functions
than those other libraries.
2. The syntax is extremely simple and easy to understand when compared to
bind's boost::protect semantics and boost.lambda's operator overloads. This
makes De Bruijn an ideal candidate for a back-end evaluator for more complex
3. The simplicity of the semantics will give users a relatively light
(for example, when compared to bind) path to unlocking all of the library's
4. The use of De Bruijn indices is a clever way to side-step the whole
function argument name issue, retain the full power of lambda calculus, and
have easily readable and writable code.
-- David Sankel Sankel Software www.sankelsoftware.com 585 617 4748 (Office)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk