diff options
author | David Robillard <d@drobilla.net> | 2009-06-18 20:22:10 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-06-18 20:22:10 +0000 |
commit | 545b524bda45f2087ac92cf58f6eaa78499332cf (patch) | |
tree | 71043cffd2b64da7420d2840a6be666b9fef037a /typing.cpp | |
parent | 4e34e229beb12164ea49b1121785dc71eb7c3566 (diff) | |
download | resp-545b524bda45f2087ac92cf58f6eaa78499332cf.tar.gz resp-545b524bda45f2087ac92cf58f6eaa78499332cf.tar.bz2 resp-545b524bda45f2087ac92cf58f6eaa78499332cf.zip |
Primitive internal macro system (for implementing sugar).
(def (f x) ...) sugar.
git-svn-id: http://svn.drobilla.net/resp/tuplr@119 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'typing.cpp')
-rw-r--r-- | typing.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -150,9 +150,9 @@ void ADefinition::constrain(TEnv& tenv, Constraints& c) const { if (size() != 3) throw Error("`def' requires exactly 2 arguments", loc); - const ASymbol* sym = at(1)->to<const ASymbol*>(); - if (!sym) - throw Error("`def' name is not a symbol", loc); + const ASymbol* sym = this->sym(); + if (!sym) throw Error("`def' has no symbol", loc); + AType* tvar = tenv.var(at(2)); tenv.def(sym, make_pair(at(2), tvar)); at(2)->constrain(tenv, c); |