Beginning work on infix operators in mexprs.
This commit is contained in:
parent
434276ecea
commit
ce7fe8f3ef
6 changed files with 152 additions and 29 deletions
|
|
@ -18,5 +18,4 @@ apply[fn;args;a] = [
|
|||
cons[cons[cadr[fn];caddr[fn]]; a]];
|
||||
eq[car[fn]; FUNARG] -> apply[cadr[fn]; args; caddr[fn]];
|
||||
eq[car[fn]; LAMBDA] -> eval[caddr[fn]; nconc[pair[cadr[fn]; args]; a]];
|
||||
T -> apply[eval[fn;a]; args; a]]
|
||||
|
||||
T -> apply[eval[fn;a]; args; a]]
|
||||
3
resources/ff.mexpr.lsp
Normal file
3
resources/ff.mexpr.lsp
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
;; From page 6 of Lisp 1.5 Programmer's Manual
|
||||
|
||||
ff[x]=[atom[x] -> x; T -> ff[car[x]]]
|
||||
3
resources/gcd.mexpr.lsp
Normal file
3
resources/gcd.mexpr.lsp
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
gcd[x;y] = [x>y -> gcd[y;x];
|
||||
rem[y;x] = 0 -> x;
|
||||
T -> gcd[rem[y;x];x]]
|
||||
Loading…
Add table
Add a link
Reference in a new issue