hy.contrib.walk: Add support for walking cons cells
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
This commit is contained in:
parent
fa24042cb0
commit
e8dfe5bfb2
@ -32,6 +32,9 @@
|
||||
(outer (HyExpression (map inner form)))]
|
||||
[(instance? HyDict form)
|
||||
(HyDict (outer (HyExpression (map inner form))))]
|
||||
[(cons? form)
|
||||
(outer (cons (inner (first form))
|
||||
(inner (rest form))))]
|
||||
[(instance? list form)
|
||||
((type form) (outer (HyExpression (map inner form))))]
|
||||
[true (outer form)]))
|
||||
|
@ -3,6 +3,7 @@
|
||||
(def walk-form '(print {"foo" "bar"
|
||||
"array" [1 2 3 [4]]
|
||||
"something" (+ 1 2 3 4)
|
||||
"cons!" (cons 1 2)
|
||||
"quoted?" '(foo)}))
|
||||
|
||||
(defn collector [acc x]
|
||||
|
Loading…
Reference in New Issue
Block a user