Dan Sugalski <[EMAIL PROTECTED]> writes:
> You're ignoring side-effects. The tied data may well be returned the
> same every time it's accessed, but that doesn't mean that things aren't
> happening behind the scenes. What if we were tracking the number of
> times a scalar/hash/array was accessed? Memoizing would kill that.
Hm. I don't really understand why this would be significant unless you're
actually benchmarking Perl's sort. Unless you care about the performance
of Perl's sort algorithm, the number of times each element is accessed in
a sort is *already* indeterminate, being a function of the (hidden) sort
implementation, and will vary a lot depending on how ordered the data
already is.
Counting on side effects determined by the *number* of times elements are
accessed during a sort sounds pretty twisted to me. I can see a few YAPHs
with such properties, but I don't think we were guaranteeing that Perl 6
would be YAPH-compatible anyway.
--
Russ Allbery ([EMAIL PROTECTED]) <http://www.eyrie.org/~eagle/>