in reply to Perl 6 Exegesis 6 pg 7
But a real routine invoking the new routine could achieve the same result.
Of course. Currying is just a shortcut.
On the other hand, putting my in the main script will not have any effect in the package, will it?
I think that's the point :-)
In Damian's example the List::Part::part() function is non-upwardly compatable with earlier versions because of the addition of the parameter.
The problem is - how do we make legacy code that calls the old-style part() use the new-style part()?
One option would be to go through them by hand and alter the calls to part() appropriately.
Instead, we can add a single line that creates a lexically scoped subroutine that curries in the old default label arguments - so the calls to the old-style part() will continue to work.
Make sense?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Perl 6 Exegesis 6 pg 7
by TomDLux (Vicar) on Aug 07, 2003 at 15:32 UTC | |
by adrianh (Chancellor) on Aug 07, 2003 at 16:50 UTC | |
by bunnyman (Hermit) on Aug 07, 2003 at 15:43 UTC |