4 ms·
Perl has a similar syntax, it is quite nice sub my_funct{ my($x, $y) = @_; #… goto &my_funct($x, $y); } In Perl this is conven
by rabbits77 5y ago
Perl has a similar syntax, it is quite nice
sub my_funct{
my($x, $y) = @_;
#…
goto &my_funct($x, $y);
}
In Perl this is convenient because effectively with just adding the goto keyword you reduce all the memory use and risk of blowing your stack (recursion is otherwise super inefficient in Perl).
- shadowofneptune 5y agoIt's fascinating to find an idea like that in Perl. Python's developers are hostile to tail-call optimization due to reasons like it complicating debugging.