Notes and incomplete work.
-rw-r--r-- 1 tonyg staff 3935 Aug 11 2009 boot.tng-modules
-rw-r--r-- 1 tonyg staff 454 Aug 9 2009 calc.tng
-rw-r--r-- 1 tonyg staff 1214 Apr 16 18:18 clojure-sequences-20100416.txt
-rw-r--r-- 1 tonyg staff 2265 Feb 24 13:20 monadic-book.tng
-rw-r--r-- 1 tonyg staff 290 Dec 29 19:37 things-to-consider.txt
define expr = {
number:n1 "+" expr:n2 -> n1 + n2;
};
define number = {
spaces digit+:digits -> digits |listToString |stringToNumber;
};
define token xs -> {
spaces <{xs}>;
};
define digit = {
c -> (charNumeric c) { .true -> c; .false -> error("expected", "charNumeric", c); };
};
spaces = {
(c -> (charWhitespace c) { .true -> c; .false -> error("expected", "charWhitespace", c) };)+
spaces;
$- $- ...
-> #t;
};
expr 1 + 2 + 3;