in reply to Re: Perl 6 Exegesis 6 pg 7
in thread Perl 6 Exegesis 6 pg 7

And that's precisely my question, where does that one line go?

If you put it in the module, you would disable the new version for all scripts that access the module, new or old. ( Besides, you wouldn't need that List::Part::part.assuming magic, ,you could just write a wrapper routine. )

If you modify the main() of each old script: it's a lot of work; how do you know you got them all?; since you're using my, the currying will be active in the file where you put the currying, which is fine for a one-file program, but what about more complex things?

--
TTTATCGGTCGTTATATAGATGTTTGCA

Replies are listed 'Best First'.
Re^3: Perl 6 Exegesis 6 pg 7
by adrianh (Chancellor) on Aug 07, 2003 at 16:50 UTC
    And that's precisely my question, where does that one line go?

    In the modules/scripts that use the old API.

    Besides, you wouldn't need that List::Part::part.assuming magic, ,you could just write a wrapper routine.

    You don't have to use a curried subroutine - but it would seem a very natural idiom to me. You're taking an existing subroutine and freezing one of its arguments. Exactly what currying does.

    Yes you could write a wrapper subroutine but currying seems more natural to me (perhaps because I've used languages before where currying is common).

    If you modify the main() of each old script: it's a lot of work; how do you know you got them all?; since you're using my, the currying will be active in the file where you put the currying, which is fine for a one-file program, but what about more complex things?

    There isn't an easy way of doing it ;-) It was just (IMO) a way for TheDamian to demo currying in a vaguely sane context.

Re: Re: Re: Perl 6 Exegesis 6 pg 7
by bunnyman (Hermit) on Aug 07, 2003 at 15:43 UTC

    You are searching for something that isn't there.

    This is just example code to show what currying is able to do, but maybe not the "proper" way to write code. My reading is that the curry goes into each old script. Let's assume there is only one or two. In real life code, you would not want to change the way a library function gets called, you would instead add a new library function that is separate from the older one, so that old code will not require changes. But then the Exegesis would not explain how currying works, and that was the whole point of talking about it in the first place.