Re: Goto? a read opinion
Jeremy,
Please look at the wiki article http://en.wikipedia.org/goto
and click on the links to Edsger Dijkstra's article, and
Donald Knuth's article. To read what the arguments of the
experts. To find examples
of goto you can look at basic programs. There is lots
of basic source around and they use goto. I downloaded
one that gives us the sunrise times. It used goto four
times. Each time, it would be easy to replace with
if/then/end-if blocks if you wanted to translate to
EUPHORIA 3.1.
With goto you can jump out of a nested for/if/for/if
for i = 1 to length(s) do if sequence(s[i]) then
for j = 1 to length(s[i]) do
if sequence(s[i]) then
goto foo
end if
end for
end if end for
foo:
puts(1,"hello\n")
Just because I can come up with code that could use goto,
doesn't mean real code designed with a purpose will need
goto. Let's read these two opposing articles to get an
informed opinion.
Shawn Pringle
|
Not Categorized, Please Help
|
|