From 482282178c952660a8441ec6264062fc569cd11d Mon Sep 17 00:00:00 2001 From: Guillermo Vaya Date: Wed, 26 Jun 2013 02:20:15 +0200 Subject: [PATCH] changed macro to ignore empty trees and made compiler do the substitution work --- hy/compiler.py | 2 ++ hy/macros.py | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hy/compiler.py b/hy/compiler.py index 4aa8365..d92ede3 100644 --- a/hy/compiler.py +++ b/hy/compiler.py @@ -1421,6 +1421,8 @@ class HyASTCompiler(object): @builds(HyExpression) def compile_expression(self, expression): + if expression == []: + return self.compile_list(expression) fn = expression[0] func = None if isinstance(fn, HyKeyword): diff --git a/hy/macros.py b/hy/macros.py index dab960a..b824cea 100644 --- a/hy/macros.py +++ b/hy/macros.py @@ -71,10 +71,7 @@ _wrappers = { def process(tree, module_name): if isinstance(tree, HyExpression): if tree == []: - # set value to [] - ntree = HyList() - ntree.replace(tree) - return ntree + return tree fn = tree[0] if fn in ("quote", "quasiquote"):