Ed Watkeys on 30 Jan 2008 07:07:11 -0800 |
Here's my cheatsheet so far. Written from a Schemer's perspective. With R6RS, I'm looking for something else to fall in love with. PG seems to have taken a step back from terseness-uber-alles and has come up with something that's pretty nice. ; (DEF funcname (a ...) e ...) ; (FN (a ...) e ...) ; (IF c1 e1 c2 e2 ... e) -- replaces COND ; (WHEN c e1 e2 ...) ; (IS a b ...) ; (ISO a b ...) ; (LET x v e ...) ; (WITH (x a y b ...) e ...) ; (DO e ...) ; (= lval val) ; t, nil ; ("foo" 0) ==> #\0 ; (LEN collection) ; (IN x a ...) ; (CASE val k1 v1 k2 v2 ... elsev) ; (FOR i lo hi e) ; (EACH x collection e) ; (WHILE c e e1 ...) ; (REPEAT n e) ; A C-like loop operator... In there somewhere... ; [ func _ arg ...] ==> (fn (x) (func x arg ...)) ; foo:bar ==> (fn (a ...) (foo (bar a ...))) ; ~foo ==> (fn (a ...) (no (foo a ...))) ; KEEP filters, REM removes, ALL t if all t, SOME, POS first position ; where t, TRUES list of all t values. All work on strings. If func arg ; is a value, treated as func that tests for equality with the value. ; (table key) ==> value ; (LISTTAB '((k1 v1) (k2 v2) ...)) ; MAPTABLE works by side effects, returns table. ; (ALREF alist key) ==> value ; (STRING v ...) ==> (for-each pr (list v ...)) ; (TOSTRING v ...) ==> "..." ; (TYPE v) ==> type-of-v ; (ISA a type) ; (COERCE v type) ==> new-v (types: 'int <radix>, 'cons, ?) ; PUSH and POP treat list as stack, work w/ any lvalue. ; ++ and -- ; (ZAP func x) ==> (= x (func x)) ; (SORT cmp collection) -- COMPARE is standard comparator ; (INSORT cmp newval collection) ; (def func (a (o b)) ...) -- b is optional, nil if not given ; (def func (a (o b e) ...) -- b is optional, = to e if not given ; Rest params as in Scheme, APPLY as in Scheme. ; (MAC macname (a ...) e ...) ; Backquoting as in Scheme. ; (UNIQ) ==> unique identifier ; (W/UNIQ V e ...) -- V can be a symbol or a list of syms ; ; QUESTIONS: DEFTEM TEMLOAD SAVE-TABLE ERRSAFE TAG ENSURE-DIR On Jan 29, 10:02 pm, "Kyle R. Burton" <kyle.bur...@gmail.com> wrote: > http://arclanguage.org/ > > I'm sure you'll all pick this up on p.r.c or n.yc at some point.... > > Kyle
|
|