develooper Front page | perl.perl6.language | Postings from March 2005

Re: Referencing a caller's slurpy array.

Thread Previous | Thread Next
Rod Adams
March 16, 2005 21:49
Re: Referencing a caller's slurpy array.
Message ID:
Luke Palmer wrote:

>Rod Adams writes:
>>In S29, I currently have C<grep> as:
>>multi sub grep (Any|Junction $test : *@values) returns List {
>>  gather {
>>    for @values -> $x {
>>      take $x if $x ~~ $test;
>>    }
>>  }
>That's the listop form.  I was referring to the method form:
>    multi sub grep (@array: *&code) returns List {
>        ...
>    }
Got it. I'll be adding that form to various functions shortly.

Could I please get a list of what forms I need to be defining in S29?

Right now I have:
- General non-OO form.
- adverbial code block form (where applicable).

I haven't gotten a solid answer on when and how Perl will autogenerate 
methods from subs. 

For instance, would


generate a call to the list op C<grep> above, or do I need to be 
defining another form of C<grep> that's more agreeable to 
autogeneration? If so, what makes a sub more agreeable to auto method 

-- Rod Adams

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About