update contrib and macro to use the new list? function
This commit is contained in:
parent
b0ed103931
commit
1c7ca7ac1f
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
(setv -registry {})
|
(setv -registry {})
|
||||||
(defn hy-repr-register [types f &optional placeholder]
|
(defn hy-repr-register [types f &optional placeholder]
|
||||||
(for [typ (if (instance? list types) types [types])]
|
(for [typ (if (list? types) types [types])]
|
||||||
(setv (get -registry typ) (, f placeholder))))
|
(setv (get -registry typ) (, f placeholder))))
|
||||||
|
|
||||||
(setv -quoting False)
|
(setv -quoting False)
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
(outer (HyExpression (map inner form)))]
|
(outer (HyExpression (map inner form)))]
|
||||||
[(instance? HyDict form)
|
[(instance? HyDict form)
|
||||||
(HyDict (outer (HyExpression (map inner form))))]
|
(HyDict (outer (HyExpression (map inner form))))]
|
||||||
[(instance? list 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))]
|
||||||
|
@ -213,7 +213,7 @@ Such 'o!' params are available within `body` as the equivalent 'g!' symbol."
|
|||||||
(defn extract-o!-sym [arg]
|
(defn extract-o!-sym [arg]
|
||||||
(cond [(and (symbol? arg) (.startswith arg "o!"))
|
(cond [(and (symbol? arg) (.startswith arg "o!"))
|
||||||
arg]
|
arg]
|
||||||
[(and (instance? list arg) (.startswith (first arg) "o!"))
|
[(and (list? arg) (.startswith (first arg) "o!"))
|
||||||
(first arg)]))
|
(first arg)]))
|
||||||
(setv os (list (filter identity (map extract-o!-sym args)))
|
(setv os (list (filter identity (map extract-o!-sym args)))
|
||||||
gs (lfor s os (HySymbol (+ "g!" (cut s 2)))))
|
gs (lfor s os (HySymbol (+ "g!" (cut s 2)))))
|
||||||
|
Loading…
Reference in New Issue
Block a user