diff options
author | David Robillard <d@drobilla.net> | 2009-06-24 04:46:57 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-06-24 04:46:57 +0000 |
commit | 2235923ea73318d3eeba64754f461209c23d9f2f (patch) | |
tree | 75fdcf48c25e26419c09f5eb064fb48dbe65fd86 /tuplr.hpp | |
parent | 0c98e0fc52c08d9c87af4e72112b8f774a04f3af (diff) | |
download | resp-2235923ea73318d3eeba64754f461209c23d9f2f.tar.gz resp-2235923ea73318d3eeba64754f461209c23d9f2f.tar.bz2 resp-2235923ea73318d3eeba64754f461209c23d9f2f.zip |
Funcs => AFn::Impls
git-svn-id: http://svn.drobilla.net/resp/tuplr@146 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'tuplr.hpp')
-rw-r--r-- | tuplr.hpp | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -340,15 +340,6 @@ struct Subst : public map<const AType*,AType*,typeLessThan> { } }; -/// Lifted system functions (of various types) for a single Tuplr function -struct Funcs : public list< pair<AType*, CFunction> > { - CFunction find(AType* type) const { - for (const_iterator f = begin(); f != end(); ++f) - if (*f->first == *type) - return f->second; - return NULL; - } -}; /// Closure (first-class function with captured lexical bindings) struct AFn : public ATuple { @@ -360,7 +351,16 @@ struct AFn : public ATuple { void liftCall(CEnv& cenv, const AType& argsT); CValue compile(CEnv& cenv); ATuple* prot() const { return at(1)->to<ATuple*>(); } - Funcs funcs; + /// System level implementations of this (polymorphic) fn + struct Impls : public list< pair<AType*, CFunction> > { + CFunction find(AType* type) const { + for (const_iterator f = begin(); f != end(); ++f) + if (*f->first == *type) + return f->second; + return NULL; + } + }; + Impls impls; mutable Subst subst; string name; }; |