Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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

by blazar (Canon)
on May 29, 2007 at 20:40 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-23 20:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found