Re: proposal: binding with a function
by Juerd other posts by this author
Jun 23 2005 8:03AM messages near this date
Re: proposal: binding with a function
|
Re: proposal: binding with a function
Piers Cawley skribis 2005-06-23 15:30 (+0100):
> Brent 'Dax' Royal-Gordon <brentdax@[...].com> writes:
> > As I've said before, Perl supports `alias`--it's just spelled `:=`.
> Here's a rubyish idiom:
> my &old_behaviour := &function;
> &function := sub { try_some_stuff || &old_behaviour }
> Except, with binding it doesn't work like that, you end up with an infinite
> loop.
I still think subs should have a value, than can be copied :)
my &old_behaviour = &function;
&function = sub { try_something || &old_behaviour };
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
Thread:
B=C1RTH=C1ZI_Andr=E1s
Larry Wall
Damian Conway
Ingo Blechschmidt
Juerd
Carl Franks
B=C1RTH=C1ZI_Andr=E1s
B=C1RTH=C1ZI_Andr=E1s
BÁRTHÁZI András
Brent 'Dax' Royal-Gordon
BÁRTHÁZI András
Brent 'Dax' Royal-Gordon
BÁRTHÁZI András
Abhijit Mahabal
|