diff options
Diffstat (limited to 'functions.c')
-rw-r--r-- | functions.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/functions.c b/functions.c index 3e5c902..3d62828 100644 --- a/functions.c +++ b/functions.c @@ -158,6 +158,13 @@ runfunc(Function f, Array *left, Array *right) } return m(right); } + }else if(f.type == FunctypeOp && f.operator.type == OperatortypeHybrid){ + opmonad m = hybridoperatordefs[f.operator.code]; + if(m == nil){ + Rune *err = runesmprint("monadic %C", primhybridnames[f.operator.code]); + throwerror(err, ENotImplemented); + } + return m(f.operator.left, left, right); }else if(f.type == FunctypeOp){ /* TODO assumes prim op, not dop */ if(f.operator.dyadic){ @@ -189,6 +196,13 @@ runfunc(Function f, Array *left, Array *right) } return f.quad->monadfn(right); } + }else if(f.type == FunctypeHybrid){ + fndyad d = hybridfunctiondefs[f.code]; + if(d == nil){ + Rune *err = runesmprint("dyadic %C", primhybridnames[f.code]); + throwerror(err, ENotImplemented); + } + return d(left, right); }else return nil; } |