diff options
-rw-r--r-- | src/expand.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/expand.cpp b/src/expand.cpp index d10b64d..53a415c 100644 --- a/src/expand.cpp +++ b/src/expand.cpp @@ -56,9 +56,7 @@ expand_def(PEnv& penv, const AST* exp, void* arg) THROW_IF(i == tup->end(), tup->loc, "Unexpected end of `def' form"); const AST* arg1 = *(++i); THROW_IF(i == tup->end(), arg1->loc, "Unexpected end of `def' form"); - if (arg1->to_symbol()) { - return expand_list(penv, tup); - } else { + if (arg1->to_tuple()) { // (def (f x) y) => (def f (fn (x) y)) const ATuple* pat = arg1->to_tuple(); @@ -83,6 +81,8 @@ expand_def(PEnv& penv, const AST* exp, void* arg) ret.head->loc = exp->loc; return expand_list(penv, ret.head); + } else { + return expand_list(penv, tup); } } |