Skip to main content
GameDev.net gamedev.net

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro — $3/month.

Looks like lisp :s

Looks like lisp :s

Daerax
Journal · · 1 min read
1,251 2
So Ive added strings, floats and booleans to the language. As well there is now named binding so programs can now be written. The language is still the pure lambda calculus, just with some sugar. its still abit sour though, kinda looks like lisp. Because it has higher order functions and the power of lambda abstractions im getting a lot of powerful behaviour almost for free. Including currying, being able to pass code about, tuple like structures. It is still useless though because there are no operators (to test some stuff implemented prefixed addition) so you cant do comparisons or complex math easily. Im currently targeting being able to run that pi example and The guessing game. :)

prod = fun x. fun y. addf x (mulf x y); /* x + y*x */partapply = prod 4.0;r = partapply 2.0; /* 12 */k = prod 4.0 3.0; /* 16 */zk  = "BOO:";ss = "lllp";id = fun x.x;id zk;when = fun b . fun x . if b then x else false;when true (     (fun x . x) ("Id is: " 5)  );p = 5 zk ss; /*   */"P is : " p; /*prints ("P is : " (5 "BOO:" ss))*/p = 5 (zk ss); /*("P is : "(5("BOO:" "lllp")))*/

Discussion

Loading comments...