Re: Good Use of GOTO
- Posted by Jim Brown <jbrown105 at linuxbudd?ist.?et> Jun 05, 2008
- 849 views
Bernie Ryan wrote: > > Jim Brown wrote: > > Because they are making the main function return? How would you have a > > function > > return, not to its caller, but its caller's caller? > > > > Also, the need to pass arguments to helper functions via the stack is > > lightly > > slower. In most cases one probably doesn't care about that. > > First this is poor example to answer CK's original question. It is not. He wanted an example where goto was used to enhance maintainability of the code. The code in the example is clear and easy to follow, and easy to maintain. > > We don't write Linux Kernel code in Euphoria. > I wasn't saying we would, or should. > You can always pass arguments and pointers. If you want speed use Pass arguments as pointers, you mean? Passing all arguments as pointers still takes up space and time through the stack. A single pointer might be better. But that adds considerable compleixty to extract the arguments. Also, you do not address my point to you, that the goto's are harder to replace with function calls because they return from the main function. > > assembler. So you have no problems with Euphoria being as slow as Java or Python, or even slower? If so, that's fine. > > Bernie > > My files in archive: > WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API > > Can be downloaded here: > <a > href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan</a>