Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re^4: [Perl 6] Any provision for a "dereferencing object"?

by blazar (Canon)
on May 29, 2007 at 20:40 UTC ( #618047=note: print w/replies, xml ) Need Help??

in reply to Re^3: [Perl 6] Any provision for a "dereferencing object"?
in thread [Perl 6] Any provision for a "dereferencing object"?

S12 is now clarified to indicate that $object.$methodname() is able to call into a closure as well as into a named method. Thanks.

"Thanks"? No, thank you! (I added a link to the quote above and I'm reporting hereafter the relevant part of the Synopsis.)

The variable may contain either the name of a method or a closure object. In the latter case the closure is called with the object as its first argument, so that a closure may be used to abstract a "navigational" path through a data structure without specifying the root of the path till later.

$locator = -> $root, $x, $y { $root.<foo>[$x]<bar>{$y}[3] } $obj.$locator(42,"baz") # $obj<foo>[42]<bar><baz>[3] $locator = { .<here> } $obj.$locator # $obj<here>

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://618047]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2021-05-09 20:48 GMT
Find Nodes?
    Voting Booth?
    Perl 7 will be out ...

    Results (102 votes). Check out past polls.