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.
The text was updated successfully, but these errors were encountered:
Proc#compose
raises an error when it shouldn't. The following two lambdas can compose:But with
Proc#compose
, it raises anArgumentError
:One solution is to wrap the inner call in a begin:
There's not really a way to check a proc's return arity at runtime, since it can return in more than one way.
The text was updated successfully, but these errors were encountered: