If the usual syntax for a 2-arg subroutine call is:

   foo A, B;       # (1)

and the preferred perl5 C<map> syntax is:

   map {...} @a;   # (2)

Then (2) is not grammatically following the same rule as (1).  It works
because there is a rule that says the {...} doesn't need the comma to
separate it from the next arg.

If the rule was, "you can leave the comma out after any argument, no
matter what type", it would be more consistent.  (But a nightmare.)

If the rule was, "you can never leave the comma out", it would be more
consistent.  (But cost one more character.)

I'm not saying it's awful, and I'm not saying it's impossible.  I'm
*just* saying that p6 does not have that syntax, _UNLESS_ it is given a
similar comma-sucking rule.  So, should there be such a rule?

I am contesting the net benefit of the rule for p6.  My objections:

1) It's a special case, which is by definition something to be generally avoided.

2) The commaless syntax looks enough like indirect object syntax to
confuse many people.  Indirect object syntax (the colon form) is already
creating a lot of confusion, and I'm worried this rule would make
matters worse.

3) Curly brackets already will have other p6 magic.  I'd rather not add
more if there is any possible way around it.

4) We have several ways around it: direct object syntax, indirect object
syntax, and pipelike syntax.

This is the sum total of my argument against the perl5 map syntax.  May
Larry have mercy on my soul.

:-/

MikeL

Reply via email to