Post Reply 
HP Prime speed vs TI-Nspire CX
11-09-2016, 06:48 AM
Post: #20
RE: HP Prime speed vs TI-Nspire CX
Hello,

1) "…The one thing that PPL lacks wrt BASIC is a GOTO statement…"
2) "How hard can it be"
3) "Goto do exist in the background to do loops"
4) "This is sorta funny in that Cyrille unabashedly uses goto in his code. You don't need to convince him of its utility!"

GOTO is all about context. If a GOTO crosses "control blocks" and "local variable start/end of existance", then GOTO are VERY hard to implement because you need first detect which boundaries are crossed and artificially exit/enter these control blocks and kill/create the local variables out of the normal process. This "rebukes" 2 and explains 3.

About 4. Yes, I do use goto (any good programmer will, every once in a while, because it makes sense).
BUT, 90% of my goto use is to exit multiple loops at once, which you can not do in C (or other programming languages)... HOWEVER, you CAN do it in PPL using the BREAK(n) and CONTINUE(n) function!!!! As far as I know, PPL is the ONLY language that has such constructs!!!
I also use it to deal with exceptional cases (errors) with a goto error; with error: at the bottom of the function so that all the cleanup code for the function and the return of an error can be handled in the same place. This is not as needed in PPL as objects and memory is cleared/freed by the system...

So, yes, I do use GOTO and no PPL does not offer a GOTO, but this should not be seen as the "pot calling the kettle black" as I did everything that I could to make GOTO as unnecessary as possible in PPL.

Enjoy your programs!
Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP Prime speed vs TI-Nspire CX - jte - 11-08-2016, 06:43 PM
RE: HP Prime speed vs TI-Nspire CX - DGM - 11-08-2016, 09:10 PM
RE: HP Prime speed vs TI-Nspire CX - cyrille de brébisson - 11-09-2016 06:48 AM
RE: HP Prime speed vs TI-Nspire CX - ttw - 11-09-2016, 08:44 AM



User(s) browsing this thread: 7 Guest(s)