aboutsummaryrefslogtreecommitdiffstats
path: root/tuplr.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'tuplr.hpp')
-rw-r--r--tuplr.hpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/tuplr.hpp b/tuplr.hpp
index 2d2886e..3df6c9f 100644
--- a/tuplr.hpp
+++ b/tuplr.hpp
@@ -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;
};