Skip to content

Instantly share code, notes, and snippets.

@cdegroot
Created January 6, 2024 02:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdegroot/7ad1db85c160c0a6626d07eb8a81e637 to your computer and use it in GitHub Desktop.
Save cdegroot/7ad1db85c160c0a6626d07eb8a81e637 to your computer and use it in GitHub Desktop.
TEST FUNARG
define ((
(double (lambda (x) (plus x x)))
))
double (6)
deflist ((
(test-fexpr (lambda (args alist)
(prog () (print args) (print alist))))
) FEXPR)
define ((
(test1 (lambda (a) (test-fexpr b c)))
))
test1 (6)
define ((
(make-adder (lambda (x) (make-closure)))
(make-closure (lambda () (function (lambda (y) (addx y)))))
(addx (lambda (z) (plus x z)))
(do-test (lambda () (prog (a)
(setq a (make-adder 4))
(print (a 2))
(print (a 3))
(setq a (make-adder 5))
(print (a 2))
(print (a 3)))))
))
do-test ()
define ((
(make-box (lambda (x) (function (lambda () (return-x)))))
(return-x (lambda () x))
(test-box (lambda () (prog (f)
(setq f (make-box 5))
(print (f)))))
))
test-box ()
STOP
FIN END OF LISP RUN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment