
21 Sep
2008
21 Sep
'08
11:17 p.m.
ajb@spamcop.net wrote:
Having said that, I don't know of a good reason why [5,5..5] is an infinte list of 5's.
I'm sure you know *why* it's an infinite list[1], but as for why that's useful I can't say. It has the feel of a bug in implementation, though it is ...consistent. As for the OP, like Python, Perl also takes [m..n] to be [] when n < m. They may not be as principled as Haskell or Erlang, but it does seem to be the consensus view. [1] Because the "5,5.." yields an (unfoldr (Just . (\x -> (x,x)) . (+0)) 5) stream but the "..5" only causes termination just as soon as the stream is surpassing 5, which it never will. -- Live well, ~wren