Re: HP67/97/41 translator




<gerard.evrard@xxxxxxx> schrieb im Newsbeitrag
news:1180023728.587561.39400@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
The main problem remains GTO ... You can't translate it in easy way...

...one of the thing that I most like in (User)RPL is the lacking of
GOTO, a superflous ...

You like to feel pain ? There is a name for this disease.

I prefer powerful languages like :
RPN (has GOTO),
Pascal (has GOTO),
C++ (has GOTO),
or even BASIC (has GOTO).
Is there a scheme here ?
I decide what I want and the language provides the support.

As for RPL, you can't even break out of a loop. Yuck.

This is NOT correct.

Of course you can 'break out' of a loop, if you really want to.
JHM shows how to do it in UserRPL,
I'll indicate how to do it in SysRPL.

Consider the following code snippet:

DO
:: ..some_code..

..test_condition..
case ExitAtLOOP

..some_other_code..
;
LOOP

If ..test_condition.. returns TRUE,
the ExitAtLOOP word will be evaluated.
ExitAtLOOP is the same as 'ZEROISTOPSTO',
in other words : Loop end has been reached.

This is the clean and supported way to terminate a loop
at any time.

You can also exit a loop using an error condition.

You could even exit a loop using return stack manipulating words,
but that would indicate a code design problem,
not a limitation of the language...

Please refer to RPLMAN.DOC for more info on this topic.

BTW: As mentioned in my earlier post, even SysRPL has a GOTO ;-)

Don't get me wrong:
When programming an HP-41, be it RPN or (in most cases) ML,
you'll need GO jumps.

However, RPL isn't RPN nor BASIC nor Pascal .
It's RPL, a combination of FORTH and LISP.

To get the most out of your HP-48 based machine,
it's best to use the language which is suited best for the platform,
and that's RPL, where you simply don't need GO jumps.

HTH

Raymond



.



Relevant Pages

  • Re: Iteration in lisp
    ... state machine is just a tagbody and goto. ... But if you need to change the state-transition-matrix in the middle ... loop and either table-driven or separate-functions for defining the ... (tagbody state1 (trace-state1 aux) ...
    (comp.lang.lisp)
  • Re: COBOL aint quite dead - yet !
    ... of control there is nothing wrong with goto. ... The loop is entirely abstracted away. ... Then we have well-formed loops with a single invariant and a looping ...
    (comp.lang.cobol)
  • Re: QBasic to BBC BASIC translator updated
    ... constructs to if then plus goto statements. ... Although a compiler doesn't need to use a stack explicitly to ... to jump out of a loop is the issue of 'static scope'. ... of any other interpreted BASICs that work that way, ...
    (comp.lang.basic.misc)
  • Re: acceptable use of goto?
    ... loop, forward within the loop at various points, then forward out of ... Then you give every statement a label. ... No goto statements. ... Then I build a framework (of if or switch statements) to eliminate the ...
    (comp.lang.c)
  • Re: 2 extends
    ... goto hop_out; hop_out: ... I think that the nested loop you provide is not only slower ... It would require the engineer to wade through 30 lines of code to make sure that the onlyFisrt boolean was not altered within it. ... onlyFirst = false; ...
    (comp.lang.java.help)