On Aug 14, 2004, at 5:52 PM, Larry Wall wrote:

If one goes with a standard method name, we also want to see what it
looks like as an indirect object:

    for more $*IN
    for iter $*IN
    for every $*IN
    for read $*IN
    for in $*IN
    for shift $*IN

Of these, I like C<every> best.

Like I say, all the good ones are taken:

    for all $*IN        # all() is junction
    for each $*IN       # each method wants closure if we follow Ruby
    for next $*IN       # next $foo is a loop exit

Hmm.  Maybe the problem is that we shouldn't follow Ruby on .each's
signature.  How about we have .apply or .filter do the Ruby implicit
iteration thing, and keep .each for iterating iterators.

Hmm.

    @bar = filter @foo: { $_ * 2 };
    @bar = @foo.filter:{ $_ * 2 };
    @bar = @foo.filter({ $_ * 2 });
    filter @foo: { $_ * 2 } ==> @bar;

C<filter> is good for this; I like it. But if you decide you need to keep it as C<each>,
then I personally really don't mind using C<every> for the iterator method.

Just my $0.02.

Regards,

David

Attachment: smime.p7s
Description: S/MIME cryptographic signature



Reply via email to