in reply to Re: The beauty of MMD
in thread Perl 5's greatest limitation is...?
Jumping into a fray that isn't mine:
I think that the point is MMD is usefull and would be nice to have. I'm not sure what your argument agianst that was except that you didn't like his argument. So here is a plain as day example using Perl6 MMD and i'd like to see your example of the same code that is at least as simple.
multi method name () { return $.name }; multi method name (Str $new_name) { $.name = $new_name; $new_name };
The return value of the second call is always debatable, but not realy the point here. This is obviously a very simple example, but the point is, anytime your action varies depending on the types of paramters, MMD is a nice trick to have available. BTW Perl6 allows MMD and allows you to still have your old fashion perl5 send me everything in @_ subs too, so you can have your cake and eat it too (whatever that means ;) )
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: The beauty of MMD
by tilly (Archbishop) on Jul 28, 2005 at 22:44 UTC | |
by eric256 (Parson) on Jul 30, 2005 at 23:52 UTC | |
by tilly (Archbishop) on Jul 31, 2005 at 01:29 UTC | |
by Tanktalus (Canon) on Jul 31, 2005 at 02:02 UTC | |
by adrianh (Chancellor) on Jul 31, 2005 at 17:11 UTC | |
by chromatic (Archbishop) on Jul 31, 2005 at 07:26 UTC | |
by fizbin (Chaplain) on Aug 06, 2005 at 10:50 UTC | |
OT: Having your cake
by kelan (Deacon) on Jul 29, 2005 at 17:49 UTC | |
by sparkyichi (Deacon) on Jul 29, 2005 at 17:55 UTC | |
by kelan (Deacon) on Jul 29, 2005 at 18:11 UTC |