Boost logo

Boost :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2003-04-12 04:51:27


Vesa Karvonen wrote:
> # This is an applicative order beta-reducer for closed lambda-terms
> # implemented using the C preprocessor.
> #
> # Usage:
> #
> # cpp lambda.cpp '-DTERM=<term>' |tail -n1|sed 's# ##g'
> #
> # The syntax of lambda-terms:
> #
> # <term> : LAMBDA(<symbol-or-_>,<term>)
> # | (<term>,<term>)
> # | <symbol>
> #
> # <symbol> : A | B | C | ... | Z
> # <symbol-or-_> : <symbol> | _

[snip]

> # For example:
> #
> # cpp lambda.cpp '-DTERM=(LAMBDA(X,X),LAMBDA(Y,Y))' |tail -n1|sed 's#
##g'
> #
> # Prints:
> #
> # LAMBDA(Y,Y)

Vesa, this is _something_!

I only wish I knew more about lambda-calculus to understand the details, and
the semantics of the term notation itself. Perhaps if you could elaborate a
little bit more on it, and may be provide a few other usage examples an
average PP-library user can associate herself with more easily, some of us
would be able to provide you with a more than just "WOW" feedback - which
this work more than certainly deserves anyway :).

Aleksey


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk