I could not. Therefore, I went Dynamic and retroactively accomplished the same thing.
lol
I donât want to even begin thinking about this!
kudos for originality
it must be by far the weirdest thing Iâve ever seen in mma
thanks for sharing
My head just hurts by thinking about it⌠Follow the letter of Edsger Dijkstra âGo To Statement Considered Harmfulâ
In an emergency â if you ever have any desire to use GoTo, please execute the following:
Graphics[{Black, Text[Style["GoTo", 80]], Red, AbsoluteThickness[15],
Circle[], Line[{{-Sqrt[1/2], -Sqrt[1/2]}, {Sqrt[1/2], Sqrt[1/2]}}]},
PlotRange -> 3/2]
On a series note, I donât think this is possible. The Label and the Goto have to be in the same âcompound expressionâ. And Label must be an explicit element. (Goto doesnât have to be an explicit element) Because of this, you canât. Also the flow control would be very confusing if it re-enters a for-loop and Iâm not sure if you want that. Try to avoid them, the readability generally goes down, though exceptions do existâŚ
An example of how to construct this Graphic should be included in the documentation for GoTo. Maybe under âApplicationsâ or âNeatExamplesâ.
Graphics[{Black, Circle,
Circle[{0, 1/3}, {1/2, 1}, {Pi + 1/4 Pi, 2 Pi - 1/4 Pi}],
AbsolutePointSize[5], Point[{{-1/2, 1/3}, {1/2, 1/3}}]},
PlotRange â 3/2]
I would be wary of any code that jumps into a loop. Thatâs just a bad idea in general. (More general: jumping into âscoping constructsâ is dangerous since you have to ascertain that the current state is as expected.) Jumping out can be safe if not done carelessly; one often exits loops in similar ways e.g. using Return.
All that said, I will also mention that Mathematica implementation of Goto and a few other jumping constructs (including Return, most especially the zero and one argument flavors but less so the undocumented two argument form) has its vagaries. The code itself is fairly sound but it relies on signals and basically has dynamically (as opposed to statically) scoped behavior. My advice is to use only in well controlled pieces of code. Again, this most likely precludes use for jumping into loops but not jumping out of them.
This may be overly general but itâs the best I can say without actual code on which to comment.
Iâm unclear, after reading Wikipedia, how I could have been using Fortran 77 in 1972. But, I think this construction worked in Fortran.
Sure, it might work. Or not. Here is a link to a Fortran 77 reference
Note in particular: "Restrictions
Jumping into the range of a DO WHILE loop from outside its range can produce unpredictable results. "
Also, that manner of coding is spaghetti, independent of the language in which it is programmed.
On a separate note, I suspect much of the Fortran 77 spec was around well before 1977. Having worked with Fortran 66 and also on a compiler for F66, I can say that F77 could not possibly have arrived soon enough.
