Michael G Schwern wrote:
> Hmmm... an object which contains a method reference which contains a
> referent to itself.
>
Yup. I don't know why some people think that circular references are complex
;-)
>
> > Something like this would be nice in a class that creates method
> > references--it would s
Michael G Schwern wrote:
> On Sun, Dec 17, 2000 at 12:11:01PM +1100, Jeremy Howard wrote:
> > Something to be careful of--it's easy to create a circular reference
when
> > using method pointers. As a result, neither the referrer nor referee
objects
> > are ever des
Michael G Schwern wrote:
> package Class::MethRef;
> use strict;
>
> sub meth_ref {
> my($proto, $method, @args) = @_;
> return sub { $proto->$method(@args) };
> }
>
>
> So this...
>
> my $meth_ref = $obj->meth_ref('foo', @some_stuff);
> $meth_ref->();
>
> is equivalent to this..
>
> $
Tom Christiansen wrote:
> Hm I don't recall C++ ever thinking to overload the control-flow
> operators ("&&", "||", "," (that is, comma), and "?:"). Why not?
> Even if their "a && b" should produce a more mundane 1 or 0, one
> still might wish control.
>
'&&', '||', et al are just operato
Damian Conway wrote:
>> How about
>>
>> %students : ( sort = $$students{^1}{GPA} <=> $$students{^0}{GPA} });
>
> Weeird! :-)
>
> Since you've strayed so close, why not go all the way and make it an
attribute:
>
> my %students : sorted( $ME{^1}{GPA} <=> $ME{^0}{GPA} );
>
> Where the