in reply to Re: Composing or chaining subroutines
in thread Composing or chaining subroutines
The impetus for this was this syntax:
The idea being that you first have a check for if the referent is a class name or a blessed reference into that class. Then, you have a check on the parameters being passed in. All of these are really easily done as closures. Except, now every single method call has some 10-40 subroutines that stack 2-3 above the body of the method which, itself, is stacked. That's a massive performance penalty, plus it makes debugging errors extremely difficult.class Foo => { class_method 'c_foo' => signature (Int, Num(5)), body => { ... }; method 'foo' => signature (Any, Hash), returns ( Int ), body => { ... }; }; Foo->add_post_process( methods => 1, class_methods => 0, action => sub { ... }, );
|
|---|