Druid-of-Luhn / lambdacalc

Basic extension of lambda calculus supporting assignments and consecutive expressions implemented in Scheme

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LambdaCalc

A basic extension of lambda calculus supporting assignments and consecutive expressions implemented in Scheme.

Parsing is performed using a CFG macro to enable writing a CFG in BNF-like form, which generates a shift-reduce parser.

Evaluation is performed using a pattern matching macro to enable dispatch based on AST node type and structure. Alpha and beta reduction are used up to the evaluation of binary operators, while symbols may need to be looked up in a global scope.

The "examples.scm" file contains a simple example demonstrating assignment of a function to a symbol and the use of that function.

(load "lambdacalc.scm")

(evaluate
  (lambda-cfg
    (lex "let double = (n . n + n), (double 5);")))

About

Basic extension of lambda calculus supporting assignments and consecutive expressions implemented in Scheme

License:Mozilla Public License 2.0


Languages

Language:Scheme 100.0%