Allow macros to return None, fixes #357
Allows Hy macros to return None, to test this (defmacro foo []) (foo) Should work now
This commit is contained in:
parent
f9a1995be8
commit
f1c68bd51a
@ -84,7 +84,8 @@ _wrappers = {
|
||||
complex: HyComplex,
|
||||
str_type: HyString,
|
||||
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),
|
||||
type(None): lambda foo: HySymbol("None"),
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,6 +34,9 @@
|
||||
(defmacro a-dict [] {1 2})
|
||||
(assert (= (a-dict) {1 2}))
|
||||
|
||||
(defmacro a-none [])
|
||||
(assert (= (a-none) None))
|
||||
|
||||
; A macro calling a previously defined function
|
||||
(eval-when-compile
|
||||
(defn foo [x y]
|
||||
|
Loading…
x
Reference in New Issue
Block a user