Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

SEXP-parser in LISP

Name: Anonymous 2010-12-27 20:55


parseWS xs -> all \Space xs
parseNumber [@xs] -> if (all digit? xs) then asBase 10 xs
parseSymbol [@xs] -> if (all alpha? xs) then asSymbol xs
parseRest x -> x.{[] => 'nil; [@!WS] => 'nil
                  [\Space @!WS e:!Sexp es:!Rest] => if es=='nil [e] [e@es]}
parseList xs -> parseRest [\Space @xs]
parseSexp x -> x.{[e:!Number]=>e; [e:!Symbol]=>e
                  [\( @!WS es:!List \)] => e}

Name: Anonymous 2010-12-28 7:39

>>5
>you've already invented enough syntax
If you call reader macros syntax

cross between Haskell, ML
I will consider such comparison as an insult. Haskell/ML symbolizes everything I hate in programming. Static math-wannabe Algol descendants with BDSM syntax.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List