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

Re: reduce metaoperator on an empty list

Thread Previous | Thread Next
Rob Kinyon
June 6, 2005 20:37
Re: reduce metaoperator on an empty list
Message ID:
On 6/6/05, Sam Vilain <> wrote:
> Roger Hale wrote:
> > This is why I would rather the o -> [o] circumfixion left [o] an infix,
> > not prefix operator.  I would rather be explicit about my identity:
> >     $product = 1 [*] @array;
> Hmm.  Not all operators *have* an identity.

So, what's wrong with not providing an identity? It's not like we
cannot have a module that says "[*] will be its own operator that
defaults to 1, [+] will default to 0", and so forth. In fact, I can
easily see a module like that being very useful.

Remember - the language DOES NOT have to provide the sinecure for all
situations. Discussions like this only emphasize that fact. Give it a
module and let it go.

In fact, if there's two different and competing implementations for
the reduce meta-operator, then maybe it's better to provide a
reduce-noident and reduce-ident and let people consciously choose
which one they want to use ...


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