Moritz Lenz wrote:
Dave Whipp wrote:
for 0..10 -> $x { ... }
is treated as
for (0...10).pick(*) -> $x { ... }
Sorry, I have to ask. Are you serious? Really?
Ah, to reply, or not to reply, to rhetorical sarcasm ... In this case, I
think I will:
Was my specific proposal entirely serious: only in that it was an
attempt to broaden the box for the discussion of semantics of coercion
ranges. One of the banes of my life is to undo the sequential mindset
that so many programmers have. I like to point out that
"sequentialization is an optimization to make programs run faster on
Von-Neumann architectures". Often, it's premature. Most of the time it
doesn't matter (compilers, and even HW, can extract ILP), but every now
and again it results in an unfortunate barrier in solution-space.
Why do we assume that ranges iterate in .succ order -- or even that they
iterate as integers (and are finite). Why not iterate as a top-down
breadth-first generation of a Cantor set? etc. Does the language need to
choose a default, or is it better require the programmer to state how
they want to coerce the range to the seq. Ten years from now, we'll keep
needing to refer questions to the .. Vs ... faq.