On Wednesday, December 11, 2002, at 06:56 PM, Simon Cozens wrote:
Yes. But Java sucks. Me no like make Perl like Java.[EMAIL PROTECTED] (Michael Lazzaro) writes:Welllll... yes and no. You can make the same argument for operators upon scalars, for example, since 'scalar' is arguably no more universal than 'array'. And we could easily use that argument to remove *all* builtins, period:Now you're getting the idea.
I would still like to be able to do things in Perl6 like:
@out = sort map {...} grep { ... } @in; # [1]
Even though that technically means having sort, map, grep as builtins.
We can make that
@out = @in.grep({...}).map({...}).sort; # [2]
if we want to grind our OO axe, but I find that syntax disappointing. I like that the idea is important enough in Perl to have it's own grammar, but I realize the problem of namespace pollution involved in having a bunch of builtins called grep, map, whatever.
The only encompassing solution would seem to be to find a grammar rule by which map,grep,etc are unambiguously methods of Array, but can still be called in a fashion similar to [1]. That would, I suspect, satisfy everyone.
MikeL