On Tue, Oct 30, 2001 at 12:27:32PM +1100, Damian Conway wrote:
> 
>    > >        ($obj1, $obj2)->foo(@args);
>    > 
>    > Is that merely sugar for:
>    > 
>    >     # errr, $_.foo(@args) ?
>    >     $_->foo(@args) foreach($obj1, $obj2);
> 
> No. What you showed would be achieved with either a hyperoperation:
> 
>       ($obj1, $obj2)^.foo(@args);

[ ... ]

>       method foo ( $me, $again : $big, $boy ) {...}
> 
> should be able to be called via either of:
> 
>       foo $obj1, $obj2 : @args;
> or:
>       ($obj1, $obj2).foo(@args);


This stuff brings to mind all sorts of questions:

* If foo() is declared as above, what values do $me and $again have when
  the method is called as $obj.foo(@args);? Is $again undef?

* What happens when foo is declared as "method foo ($a: *@_) { ... }"
  and called as "foo $a, $b: @args;"? Is $b ignored?

* Would "foo $a, $b ^: @args" work as "($a,$b)^.foo(@args)"?

* Would (($o1,$o2),($o3,$o4))^.foo(@args); be the same as
  ($o1,$o2).foo(@args); ($o3,$o4).foo(@args); ?

* "method foo ($a, $b: *@_) { ... }; foo $o1, $o2: @args;" seems like a
  binding that doesn't mention :=. i.e., ($a,$b) := ($o1,$o2); Will
  there be other "hidden" uses of the := operator?

-Scott
-- 
Jonathan Scott Duff
[EMAIL PROTECTED]

Reply via email to