in reply to Re^7: Sorting, recursion, and tail-call optimizations
in thread Sorting, recursion, and tail-call optimizations
I know, but that is where I can actually see a problem, not with @_.
When the comparator is first called, if no parameters are passed, then @_ should be empty and $_[0] is "undefined".Yep, spot on. I auto-vivify $_[0] the first time it is called (which works great).
In which case, you are probably incrementing the address of the comparator itselfI am only vaguely getting at what you are trying to say here. The value of $_[0] is correctly being auto-vivified, incremented, and preserved between calls. I would think if it were the address of the comparator itself getting incremented then the second call wouldn't be possible.
I am not saying you are wrong because I definately respect your knowledge. I am just saying that nothing in any of my tests lead me to believe something is a miss with @_. The only thing that isn't behaving correctly is $a and $b. Even if it was with @_ - I still don't see how sort routine @list and sort { routine() } @list would make that much of a difference.
Cheers - L~R
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: Sorting, recursion, and tail-call optimizations
by BrowserUk (Patriarch) on Jan 06, 2006 at 19:07 UTC | |
by Limbic~Region (Chancellor) on Jan 06, 2006 at 19:14 UTC | |
by BrowserUk (Patriarch) on Jan 06, 2006 at 19:39 UTC |