Happy !
CipT / MonLambda
About MonLambda
A simple untyped Lambda calculus
- Grammar
- AST
- Interpreter
- Monitoring support :
- profiler
- tracer
Loading the code:
Gofer new smalltalkhubUser: 'CipT' project: 'MonLambda';
package: 'MonLambdaLoader'; load.
(Smalltalk at: #MonLoader) perform: #loadV1.
"Example of simple interpretation"
|ast eval|
"create AST"
ast := MPLambdaASTBuilder
parse:
'letrec mul = \x. \y. (* x y) in
letrec fac = \x.
if (= x 0)
then 1
else ((mul x) (fac (+ x -1)))
in (fac 10)'.
"create the interpreter valuation"
eval := MPLambdaValuation new.
ast accept: eval.
"Example of a tracer run on factorial"
MPLambdaMonitoringValuationDependencies example1.
