Peter Haworth: # @b = @a.grep { /\S/ }, $c; # # how does the compiler know whether $c is an argument to grep, # or another element to be assigned to @b?
The same way it does when it sees a normal sub? I know, late binding and all that. But when you think about it, a lot can be done to simulate the conditions otherwise. For example, with a definition like this: class Foo { method bar($self: $baz) { ... } } And a call like this: @b=$foo_obj.bar $baz, $quux; Where we can see *at runtime* that $quux is too many arguments, we can just append it to the end of bar()'s return value. (This would only happen when there were no parentheses.) Similarly, with: class Foo { method bar($self: HASH $baz) { ... } } And: %b=foo_obj.bar { baz() }; We can call the closure and construct a hashref from the value. --Brent Dax <[EMAIL PROTECTED]> @roles=map {"Parrot $_"} qw(embedding regexen Configure) "If you want to propagate an outrageously evil idea, your conclusion must be brazenly clear, but your proof unintelligible." --Ayn Rand, explaining how today's philosophies came to be