You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One solution is to wrap the inner call in a begin:
classProcdefcompose(g)lambdado |*a|
beginself[ *g[*a]]rescueArgumentError=>eputs"#{e.class}: #{e.message}"# or whatever message is appropriateputse.backtraceendendendend
There's not really a way to check a proc's return arity at runtime, since it can return in more than one way.
Proc#compose is deprecated (removal after 2027-09-30) and now just calls Ruby's Proc#<<, so Facets' arity check is gone. Ruby passes the inner result to the outer proc as one argument; for a multi-value return, splat explicitly: ->(n){ take_twin[*make_twin[n]] }.
Activity
trans commentedon Jan 9, 2016
Hmm... good point. Perhaps we can just get rid to the argument error condition altogether?
trans commentedon Nov 2, 2026
Proc#composeis deprecated (removal after 2027-09-30) and now just calls Ruby'sProc#<<, so Facets' arity check is gone. Ruby passes the inner result to the outer proc as one argument; for a multi-value return, splat explicitly:->(n){ take_twin[*make_twin[n]] }.