Re: How do I... invoke a method reference

2005-05-20 Thread TSa (Thomas Sandlaß)
C. Scott Ananian wrote: I think Ingo was trying to explicitly specify the normally-implicit invocant; ie, invoke the method via the reference *without* using a '.'. If this is possible (and I think it is), it's not (yet) clear what the syntax would be. Maybe $ref(Foo.new():) I think for MMD c

Re: How do I... invoke a method reference

2005-05-19 Thread C. Scott Ananian
On Thu, 19 May 2005, Juerd wrote: Ingo Blechschmidt skribis 2005-05-19 22:45 (+0200): class Foo { method bar() { 42 } method baz() { &bar } } my $ref = Foo.baz; My guess: Foo.$ref $object.$ref Just like in Perl 5. I think Ingo was trying to explicitly specify the normally-implic

Re: How do I... invoke a method reference

2005-05-19 Thread Juerd
Ingo Blechschmidt skribis 2005-05-19 22:45 (+0200): > class Foo { > method bar() { 42 } > method baz() { &bar } > } > my $ref = Foo.baz; My guess: Foo.$ref $object.$ref Just like in Perl 5. Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_ju

How do I... invoke a method reference

2005-05-19 Thread Ingo Blechschmidt
Hi, class Foo { method bar() { 42 } method baz() { &bar } } my $ref = Foo.baz; $ref(); # Don't think this will work # (Error: No invocant specified or somesuch) $ref(Foo.new); # But will this work? How do I specify multiple invocants (when dealing wit