Created
July 15, 2012 17:22
-
-
Save osa1/3117783 to your computer and use it in GitHub Desktop.
garip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
λ> (make-application (read "+") (read "'(1 2)")) | |
<Syntax> | |
λ> (eval (make-application (read "+") (read "'(1 2)"))) | |
3 | |
λ> eval | |
<Fexpr> | |
λ> (defun garip-fn (fn param) (+ 10 (fn param))) | |
<Function> | |
λ> (garip-fn eval 10) | |
20 | |
λ> (garip-fn eval (read "123123")) | |
123133 | |
---- | |
λ> $(deff apply-fexpr (p1 p2) ((eval p1) (eval p2))) | |
<Fexpr> | |
λ> (apply-fexpr println "ok") | |
ok | |
Nil | |
λ> $(deff fexpr-2 (p1 p2) ((eval p1) p2)) | |
<Fexpr> | |
λ> (fexpr-2 println "ok") | |
<Syntax> | |
Nil | |
λ> eval | |
<Fexpr> | |
λ> (apply + (list 1 2)) | |
3 | |
λ> (apply + 1 2) | |
3 | |
λ> $(deff my-if (pred then else) (if (eval pred) (eval then) (eval else))) | |
<Fexpr> | |
λ> (my-if #t (println "ok") (println "nop")) | |
ok | |
Nil | |
λ> (my-if #f (println "ok") (println "nop")) | |
nop | |
Nil | |
λ> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment