set the value of empty hy expression to []
This commit is contained in:
parent
9b45dd4ffe
commit
7b7b953410
@ -70,7 +70,12 @@ _wrappers = {
|
||||
|
||||
def process(tree, module_name):
|
||||
if isinstance(tree, HyExpression):
|
||||
try:
|
||||
fn = tree[0]
|
||||
except IndexError:
|
||||
ntree = HyList()
|
||||
ntree.replace(tree)
|
||||
return ntree
|
||||
if fn in ("quote", "quasiquote"):
|
||||
return tree
|
||||
ntree = HyExpression(
|
||||
|
@ -755,3 +755,7 @@
|
||||
(continue))
|
||||
(.append y x))
|
||||
(assert (= y [5])))
|
||||
|
||||
(defn test-empty-list []
|
||||
"Evaluate an empty list to a []"
|
||||
(assert (= () [])))
|
Loading…
x
Reference in New Issue
Block a user