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):
|
def process(tree, module_name):
|
||||||
if isinstance(tree, HyExpression):
|
if isinstance(tree, HyExpression):
|
||||||
|
try:
|
||||||
fn = tree[0]
|
fn = tree[0]
|
||||||
|
except IndexError:
|
||||||
|
ntree = HyList()
|
||||||
|
ntree.replace(tree)
|
||||||
|
return ntree
|
||||||
if fn in ("quote", "quasiquote"):
|
if fn in ("quote", "quasiquote"):
|
||||||
return tree
|
return tree
|
||||||
ntree = HyExpression(
|
ntree = HyExpression(
|
||||||
|
@ -755,3 +755,7 @@
|
|||||||
(continue))
|
(continue))
|
||||||
(.append y x))
|
(.append y x))
|
||||||
(assert (= y [5])))
|
(assert (= y [5])))
|
||||||
|
|
||||||
|
(defn test-empty-list []
|
||||||
|
"Evaluate an empty list to a []"
|
||||||
|
(assert (= () [])))
|
Loading…
Reference in New Issue
Block a user