Re: RFC from a newbie: Method References

2000-12-18 Thread Jeremy Howard
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

Re: RFC from a newbie: Method References

2000-12-17 Thread Jeremy Howard
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

Re: RFC from a newbie: Method References

2000-12-16 Thread Jeremy Howard
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.. > > $

Re: RFC 159 (v1) True Polymorphic Objects

2000-08-28 Thread Jeremy Howard
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

Re: RFC 124 (v1) Sort order for any hash

2000-08-18 Thread Jeremy Howard
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