From 4c7b4f70e3cbfff1752f1ab06bfc9ae13c375483 Mon Sep 17 00:00:00 2001 From: Guillermo Vaya Date: Wed, 26 Jun 2013 01:58:28 +0200 Subject: [PATCH] changed try to testing for an empty list for legibility (as suggested by paultag), also added to authors --- AUTHORS | 1 + hy/macros.py | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index 92c6c0b..5fb15b6 100644 --- a/AUTHORS +++ b/AUTHORS @@ -13,3 +13,4 @@ * rogererens * Thomas Ballinger * Morten Linderud +* Guillermo VayĆ” \ No newline at end of file diff --git a/hy/macros.py b/hy/macros.py index 32ac483..dab960a 100644 --- a/hy/macros.py +++ b/hy/macros.py @@ -70,12 +70,13 @@ _wrappers = { def process(tree, module_name): if isinstance(tree, HyExpression): - try: - fn = tree[0] - except IndexError: + if tree == []: + # set value to [] ntree = HyList() ntree.replace(tree) return ntree + + fn = tree[0] if fn in ("quote", "quasiquote"): return tree ntree = HyExpression(