diff --git a/hy/contrib/walk.hy b/hy/contrib/walk.hy index a69078d..a846ed3 100644 --- a/hy/contrib/walk.hy +++ b/hy/contrib/walk.hy @@ -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)])) diff --git a/tests/native_tests/contrib/walk.hy b/tests/native_tests/contrib/walk.hy index 24feb76..d6ecbf8 100644 --- a/tests/native_tests/contrib/walk.hy +++ b/tests/native_tests/contrib/walk.hy @@ -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]