hashmaps are now first class objects in the language

This commit is contained in:
Felix Brendel
2019-10-04 17:48:31 +02:00
parent ac70c14e5b
commit 5e82f9175d
15 changed files with 166 additions and 51 deletions
+4
View File
@@ -1,3 +1,7 @@
(define hm/set! hash-map-set!)
(define hm/get hash-map-get)
(define-syntax (pe expr) `(print ',expr "evaluates to" ,expr))
(define-syntax (when condition . body) :doc "Special form for when multiple actions should be done if a\ncondition is true.\n\n{{{example_start}}}\n(when (not ())\n (print "Hello ")\n (print "from ")\n (print "when!"))\n\n(when ()\n (print "Goodbye ")\n (print "World!"))\n{{{example_end}}}\n" (if (= (rest body) ()) `(if ,condition (unquote-splicing body) nil) `(if ,condition (begin (unquote-splicing body)) nil)))