Re: Goto Examples?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Jeremy Cowgar wrote:
>Does anyone have examples of where goto is better than existing syntax?

I direct your attention to this 1974 paper by Donald Knuth.

  http://pplab.snu.ac.kr/courses/adv_pl05/papers/p261-knuth.pdf

-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

>   end for
> end while
> 
> or, if you absolutely need a "label" statement
> 
> while 1 do ~top
>   for a = 1 to 10 do ~mid
>   end for
> end while

I think for as much as it will be used and for clarity and parsing reasons,
label "abc" would be best, but others may disagree. It especially will not work
after the do. It would be hard to detect if it's the first execution token of the
block or a label. Also, I do not think the label would need to be quoted, it
would just be label top.

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu