As I said before prototypes are a hack. So not all of the special behaviour of map/grep is provided by the prototype. My guess is that this has to do with the issues related to providing complete map or print like behaviour to generalized subs. Too many rules are violated by these procedures for it to be worthwhile to support it except in very special cases. Consider that you didnt cover all the ways that map can be called:
The last one is an example of the troubles that come with map's handling. It parses asprint map { "foo $_" } @list; print map({"foo $_"} @list); print map "foo $_", @list; print map("foo $_", @list); print map(sub { "foo $_" },@list); # this doesnt do what you think....
which frankly would seem to be an odd interpretation for a user generated function. Luckily we are trained from the get go to treat map as an unusal keyword.print map { sub { "foo $_" } } @list;
--- demerphq
my friends call me, usually because I'm late....
In reply to Re: Re: Re: & function prototypes and parens
by demerphq
in thread & function prototypes and parens
by steves
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |