Juerd writes:
> Which assumptions are wrong?
>     
>     foo (3) + 4;    # foo(7)
>     foo(3) + 4;     # foo(3)
>     foo.(3) + 4;    # foo(3)
>     foo .(3) + 4;   # foo(3)
> 
>     $foo (3) + 4;   # syntax error
>     $foo(3) + 4;    # $foo(3)
>     $foo.(3) + 4;   # $foo(3)
>     $foo .(3) + 4;  # $foo(3)
> 
>     $o.m (3) + 4;   # syntax error
>     $o.m(3) + 4;    # m(3)

none(@above)

> What do these mean?
> 
>     $o.m .(foo)     # m(foo) or m().(foo) ???
>     $o.m.(foo)      # m(foo) or m().(foo) ???
>     
> In the case of m(foo), m().(foo) is the obvious way to call the returned
> sub.
> 
> In the case of m().(foo), I would not have any idea how to put
> whitespace in between method and opening paren.
> 
> This leads me to believe that $o.m.(foo) and $o.m .(foo) are $o.m(foo).

Yep.

> Parens cannot be used to group an expression which is then
> used as a method name:
> 
>     $o.("on_" ~ %methods{$event}).();  # $o(...)

Well, you can't do that anyway.  It has to be:

    $o.::("on_" ~ %methods{$event}).()

Which I believe does the right thing anyway.

Luke

Reply via email to