Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

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


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

UPDATE: Oh, I see what you're up to I think. Some function you build once and applicate anwhere. I am also a little surprised your $x->$deref.

Well, that's a bit of common OO syntactical sugar: if $code contains a subref, then in

$object->$code(@args);

the corresponding sub is called as a method on $object. This is often used to implement callbacks in a way that personally I like:

$object->record( name => 'doit', callback => sub { my $caller=shift; # ... } );

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2021-04-19 13:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?