### These are the true basis of using the vau calculus. ### vau: (# [[{}, var], # [[static, body], # [arg, do arg': (# [var, arg]) env': (# [arg', static]) (# [env', body]); ]]]) λ: (vau [{}, var] (vau [static, body] (vau arg do arg': (# arg) env': (# [# [var, arg'], static]) (# [env', body]); ))) let: __let__ Y: (λ f (let maker (λ x (f (λ arg (x x arg)))) (maker maker))) ### These are just prettier ways of getting at important primitives. ### eval: (λ env (λ ast (# [env, ast]))) match: (λ var (λ val (# [var, val]))) with: (λ base (λ new (# [new, base]))) ### These are necessary for syntactic sugar. ### __lambda__: λ __Y__: Y __quote__: (vau [{}, ast] ast) __get__: (vau [{}, field] (λ x (# [x, field]))) __modify__: (vau [{}, field] (λ f (λ x (x .with (field .match (f (__get__ feild x)))) ))) ### Pretty data primitives. Probably should be in their own file. ### _+_: (λ x (λ y (# [x, y]))) _-_: (λ x (λ y (# [x, y]))) _*_: (λ x (λ y (# [x, y]))) _/_: (λ x (λ y (#
[x, y]))) ### Now, really common operations. Probably should be in their own file. ### ifz_then_else_: (λ p (vau c (vau a (# (# [p, c, a]))))) --: (λ x (# [x, 1])) swap: (λ [a, b] [b, a])