While chaining is neato and all, I can't think of a good reason to support this use.
I can. Lots. There's many a time you can't stuff everything into a constructor, and then live with the object ever after. Sometimes you have to twiddle the object repeatedly during the life of the program. In that context, method chaining usually results in more compact, clearer code.
Take a look at this review of HTML::CalendarMonth, which is an example of where I think chained methods would be a big win.
• another intruder with the mooring in the heart of the Perl
In reply to Re^2: Method Chaining and Accessors
by grinder
in thread Method Chaining and Accessors
by linenoise
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |