# For Loop With Custom Upvar Change

Extended For

Two examples are provided for saying letters of the alphabet. One uses an explicit |report []|, the other just uses the implicit |report []| made by a Procedure-type gray ring.

That's clever. I'm trying to think if there's a way to defend against jumping over the end value, e.g., by adding 3 to the unicode in your example. For text you could use ≥ as the end test, same as for numbers, but if the domain isn't fully ordered, e.g., complex numbers, it's trickier.

But maybe nobody would want to use FOR on a non-fully-ordered domain?

I have an idea! I'll go make it really quick. (And yes, really quick)

Edit: Done! Let me know if that really solves it.

Yes, that's beautiful. (Of course it's possible to make an infinite loop, e.g., "as long as (true)", but much harder to do by accident.)

Thanks!

That's true, but that's just something you'd have to deal with. (I think JS for has that same possibility.)

Oh, yes, of course! It's provably impossible to prevent any possible infinite loop in software. See a proof here.

I knew (kind of) how to solve the examples on the first page, but the second was entirely new to me.

I hope you enjoyed it. Turing's proof was pretty much (roughly tied with Alonzo Church) the beginning of theoretical computer science.

I did! Yeah.

By the way, I remember Alan Turing('s name, and) for the Turing Test, what defines a Turing Machine (Turing Completeness), and the cracking of the Enigma.

The next page talks about the halting problem (which I am familiar with). I experimented with the halting problem here: Snap! 6.9.1 Build Your Own Blocks, and I asked the question, "What if we assumed that a program running for some time (e.g. 10 seconds) doesn't halt?".

Snap! doesn't seem to notice the paradox. It just runs the

 _______
|forever|
|_______
|_______|


block.