Larry Wall wrote:
> 
> If we're going to make it a method, however, it's possible that "curry"
> is the wrong popular name, despite its being the correct technical name.
> There's really nothing about the word "curry" that suggest partial
> binding to the casual reader.  Perhaps we really want something like:
> 
>     my &half = &div.prebind(y => 2);
> 
> or:
> 
>     my &half = &div.rewrite(y => 2);
> 
> or even:
> 
>     my &half = &div.assume(y => 2);
> 
> I think I like that last one the best.  Maybe it would read better as
> "assuming".  But that's getting a bit long for Mr Huffman.  Maybe it's
> finally time to reach into our bag of English topicalizers and pull out
> "with":
> 
>     my &half = &div.with(y => 2);

"with" reads very nicely, but we already have a perl6 precedent,
perhaps... how about reusing "when" as the method name for currying? 
This may not curry favor with Damian, but I suggest

  my & half = & div.when(y => 2);

would declare the subroutine "half" to be equal to the subroutine "div"
when the parameter y is given the value 2.  The code and the English
both read very nicely IMHO, and virtually identically, and the English
version seems even more clear to me when using "when" rather than with
"with". 

Further, there is a nice analogy with the usage of the keyword "when" in
a given clause and the usage of the method name "when" to perform
currying: both "when"s specify particular values that control the choice
of code to be executed.  The "given" keyword supplies the 'parameters'
for the "given" statement, and the original function declaration
supplies the parameters for the original function.


> Larry

-- 
Glenn
=====
Remember, 84.3% of all statistics are made up on the spot.

Reply via email to