diff --git a/hy/macros.py b/hy/macros.py index d3530fd..32ac483 100644 --- a/hy/macros.py +++ b/hy/macros.py @@ -70,7 +70,12 @@ _wrappers = { def process(tree, module_name): if isinstance(tree, HyExpression): - fn = tree[0] + try: + fn = tree[0] + except IndexError: + ntree = HyList() + ntree.replace(tree) + return ntree if fn in ("quote", "quasiquote"): return tree ntree = HyExpression( diff --git a/tests/native_tests/language.hy b/tests/native_tests/language.hy index 534ae40..004f0b8 100644 --- a/tests/native_tests/language.hy +++ b/tests/native_tests/language.hy @@ -755,3 +755,7 @@ (continue)) (.append y x)) (assert (= y [5]))) + +(defn test-empty-list [] + "Evaluate an empty list to a []" + (assert (= () []))) \ No newline at end of file