diff --git a/etuples/dispatch.py b/etuples/dispatch.py index 4c6a435..da94d62 100644 --- a/etuples/dispatch.py +++ b/etuples/dispatch.py @@ -101,6 +101,11 @@ def apply_ExpressionTuple(rator, rands): operator, arguments, term = rator, rands, apply +@dispatch(object) +def etuplize_fn(op): + return etuple + + @dispatch(object) def etuplize( x, @@ -140,6 +145,7 @@ def etuplize_step( return_bad_args=return_bad_args, convert_ConsPairs=convert_ConsPairs, ): + if isinstance(x, ExpressionTuple): yield x return @@ -182,6 +188,6 @@ def etuplize_step( ) et_args.append(e) - yield etuple(et_op, *et_args, evaled_obj=x) + yield etuplize_fn(op)(et_op, *et_args, evaled_obj=x) return trampoline_eval(etuplize_step(x))