diff options
author | David Robillard <d@drobilla.net> | 2009-10-16 03:20:22 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-10-16 03:20:22 +0000 |
commit | 195598d60fec7a9ea2096143d853fab8232b5138 (patch) | |
tree | a768c19d5b59db09df0b6ee52e2ee6e1fb8a0ba0 /src/unify.cpp | |
parent | c2d75892af2fdc6b9bf25365a15de5dc63bcc852 (diff) | |
download | resp-195598d60fec7a9ea2096143d853fab8232b5138.tar.gz resp-195598d60fec7a9ea2096143d853fab8232b5138.tar.bz2 resp-195598d60fec7a9ea2096143d853fab8232b5138.zip |
. operator for destructuring Tuples (cons).
git-svn-id: http://svn.drobilla.net/resp/tuplr@236 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/unify.cpp')
-rw-r--r-- | src/unify.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/unify.cpp b/src/unify.cpp index 92957c0..5255f54 100644 --- a/src/unify.cpp +++ b/src/unify.cpp @@ -109,7 +109,9 @@ Constraints::replace(AType* s, AType* t) Subst unify(const Constraints& constraints) { - if (constraints.empty()) return Subst(); + if (constraints.empty()) + return Subst(); + AType* s = constraints.begin()->first; AType* t = constraints.begin()->second; Constraints cp = constraints; @@ -127,6 +129,8 @@ unify(const Constraints& constraints) AType::iterator si = s->begin() + 1; AType::iterator ti = t->begin() + 1; for (; si != s->end() && ti != t->end(); ++si, ++ti) { + if ((*si)->str() == "..." || (*ti)->str() == "...") + return unify(cp); AType* st = (*si)->to<AType*>(); AType* tt = (*ti)->to<AType*>(); assert(st && tt); |