> Trey asked:
> 
> > To take the E6 example of currying &part:
> > 
> >    &List::Part::part.assuming(labels => <<sheep goats>>)
> > 
> > One had to curry in C<labels> to be the same as it was defined in C<&part>
> > originally, i.e. C<< <<sheep goats>> >>.
> > 
> > What if one wanted to curry in whatever the default is, i.e., assuming
> > "nothing" (different from "assuming nothing"), so that if List::Part::part
> > changed its default for C<labels> to C<< <<oves caperes>> >>, the client
> > code would pick that up?
> 
> If you're assuming "nothing", don't use C<.assuming> (since you aren't ;-) 
> Just write:
> 
>       sub my_part(Selector $s, [EMAIL PROTECTED]) { part $s <== *data }
> 
> and let C<&part> do the assuming for you.

Gee, that's about as helpful as saying to do &baz.assuming(foo => 'bar'):

    sub my_baz([EMAIL PROTECTED]) {
        baz foo => 'bar' <== [EMAIL PROTECTED]
    }

Wasn't the whole idea of assuming to make it easy to curry without
knowing the entire signature, and being tolerant to changes?  I see a
simple solution:

    our &my_part := &part.assuming('labels');

Or, maybe if we're caught up on readability (and error checking):

    our &my_part := &part.assuming(none 'labels');

Luke

> Damian

Reply via email to