Check for HySequence in hy.contrib.walk
This commit is contained in:
parent
95ad5a01c8
commit
4a40ff3d7e
@ -4,6 +4,7 @@
|
|||||||
;; license. See the LICENSE.
|
;; license. See the LICENSE.
|
||||||
|
|
||||||
(import [hy [HyExpression HyDict]]
|
(import [hy [HyExpression HyDict]]
|
||||||
|
[hy.models [HySequence]]
|
||||||
[functools [partial]]
|
[functools [partial]]
|
||||||
[importlib [import-module]]
|
[importlib [import-module]]
|
||||||
[collections [OrderedDict]]
|
[collections [OrderedDict]]
|
||||||
@ -17,9 +18,7 @@
|
|||||||
(cond
|
(cond
|
||||||
[(instance? HyExpression form)
|
[(instance? HyExpression form)
|
||||||
(outer (HyExpression (map inner form)))]
|
(outer (HyExpression (map inner form)))]
|
||||||
[(instance? HyDict form)
|
[(or (instance? HySequence form) (list? form))
|
||||||
(HyDict (outer (HyExpression (map inner form))))]
|
|
||||||
[(list? form)
|
|
||||||
((type form) (outer (HyExpression (map inner form))))]
|
((type form) (outer (HyExpression (map inner form))))]
|
||||||
[(coll? form)
|
[(coll? form)
|
||||||
(walk inner outer (list form))]
|
(walk inner outer (list form))]
|
||||||
|
Loading…
Reference in New Issue
Block a user