Goto In Cplua?
Started by
Xerxes
, Feb 20 2007 12:26 PM
6 replies to this topic
#1
Posted 20 February 2007 - 12:26 PM
Is it possible to use Label and Goto in CPLua?
#2
Posted 20 February 2007 - 01:51 PM
No, and it will never be.
#3
Posted 20 February 2007 - 03:48 PM
Use While, For and Repeat loops, it's much better. Labels should never be used.
#4
Posted 20 February 2007 - 04:20 PM
Yes, totally agree. In fact, Goto's are for vacuum tubes computers and Fortran IV, COBOL!
#5
Posted 20 February 2007 - 07:07 PM
Thanks for your advice, but of course I usually don't use Goto also, except for languages like Assembler or keystroke calculators.
I asked to know, if it is neccessary to make a structured version of a non-structured program to execute it at CPLua. In C for example it is possible to use Goto.
I asked to know, if it is neccessary to make a structured version of a non-structured program to execute it at CPLua. In C for example it is possible to use Goto.
#6
Posted 21 February 2007 - 03:45 PM
Gotos? Brrrr...Is it possible to use Label and Goto in CPLua?
If you have a non-structured code that you really need, you must translate it to CPLua. This task may be horribly difficult, especially if the non-structured code uses gotos extensively... in that case, translation is a real nightmare, and I personally prefer to rewrite the code from scratch.I asked to know, if it is neccessary to make a structured version of a non-structured program to execute it at CPLua. In C for example it is possible to use Goto.
However, I don't think that CPLua is a real "structured" language (at least not as structured as Fortran 95 or Pascal). CPLua allows data hiding, which is very-very useful for structured programming, but there is no variable declaration, which reminds me the old Basic. Anyway, CP is a calculator; that being said, CPLua is "structured enough", fast, and by far better than CPBasic.
#7
Posted 22 February 2007 - 01:00 PM
I agree, that it's better to make a new version of the code before trying to translate it. The reason for asking is, that I am looking for different calculators and programming languages for benchmarking. The algorithm is not structured because of the minimal language of some calcs, to have exactly the same duty. Of course it's possible to make a structured version, but until now it was not neccessary.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users