Fix for #497
One would expect the form: > (defmacro a (&rest b) b) > (a 1 2) To return a tuple object but we have no Hy model so it returns a HyList. Not sure if this is the right thing to do.
This commit is contained in:
parent
c1147c93a8
commit
b97e0258e1
@ -115,6 +115,7 @@ _wrappers = {
|
|||||||
str_type: HyString,
|
str_type: HyString,
|
||||||
dict: lambda d: HyDict(_wrap_value(x) for x in sum(d.items(), ())),
|
dict: lambda d: HyDict(_wrap_value(x) for x in sum(d.items(), ())),
|
||||||
list: lambda l: HyList(_wrap_value(x) for x in l),
|
list: lambda l: HyList(_wrap_value(x) for x in l),
|
||||||
|
tuple: lambda t: HyList(_wrap_value(x) for x in t),
|
||||||
type(None): lambda foo: HySymbol("None"),
|
type(None): lambda foo: HySymbol("None"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,6 +31,9 @@
|
|||||||
(defmacro a-list [] [1 2])
|
(defmacro a-list [] [1 2])
|
||||||
(assert (= (a-list) [1 2]))
|
(assert (= (a-list) [1 2]))
|
||||||
|
|
||||||
|
(defmacro a-tuple [&rest b] b)
|
||||||
|
(assert (= (a-tuple 1 2) [1 2]))
|
||||||
|
|
||||||
(defmacro a-dict [] {1 2})
|
(defmacro a-dict [] {1 2})
|
||||||
(assert (= (a-dict) {1 2}))
|
(assert (= (a-dict) {1 2}))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user