HP Forums
Mystery Prime commands - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Mystery Prime commands (/thread-11442.html)



Mystery Prime commands - Joe Horn - 09-22-2018 10:16 PM

When you type a nonexistent command word by itself in CAS, it just gets returned as-is, like "bananna" in the screenshot below. When you type an existing command by itself in CAS, it either gets returned with single-quotes around it, like 'factor' below, or it returns an error string, like "Mod" below, or it pops up a "Syntax Error" box, like "esac" below.

[Image: mystery_commands.png]

Since typing all of the following commands by themselves in CAS pops up a syntax error, I assume that they are either undocumented CAS commands, or undocumented Prime commands of some sort, possibly program structure commands. Anybody know what these mystery commands are, and what their syntax is? The first three are clearly normal commands spelled backwards. How many more undocumented commands are hidden in Prime?

esac
fi
elif
localbloc
proc
otherwise
try_catch
stack
default


RE: Mystery Prime commands - Eric Rechlin - 09-22-2018 11:56 PM

They mostly look like flow control keywords.

Probably "esac" ends a case statement and "fi" ends an if statement, and "elif" may be shorthand for else if. I think "localbloc" and "proc" sound like ways of defining functions/procedures. Usually "default" is a keyword in case statements. Both "try_catch" and "stack" are probably useful for exception handling and reporting. No idea on "otherwise".


RE: Mystery Prime commands - rprosperi - 09-23-2018 01:22 AM

(09-22-2018 11:56 PM)Eric Rechlin Wrote:  They mostly look like flow control keywords.

Probably "esac" ends a case statement and "fi" ends an if statement, and "elif" may be shorthand for else if. I think "localbloc" and "proc" sound like ways of defining functions/procedures. Usually "default" is a keyword in case statements. Both "try_catch" and "stack" are probably useful for exception handling and reporting. No idea on "otherwise".

"otherwise" is used in some language (that I can't recall) for the 'otherwise' condition in a case statement, similar to how 'default' is used.

Given the logical and clearly related uses Eric has suggested, it sure looks like they are indeed reserved, but not-yet implemented, control keywords.

@Joe - how did you encounter these, ROM-walking?


RE: Mystery Prime commands - Joe Horn - 09-23-2018 01:38 AM

(09-23-2018 01:22 AM)rprosperi Wrote:  @Joe - how did you encounter these, ROM-walking?

Yep! Big Grin


RE: Mystery Prime commands - rprosperi - 09-23-2018 01:45 AM

(09-23-2018 01:38 AM)Joe Horn Wrote:  
(09-23-2018 01:22 AM)rprosperi Wrote:  @Joe - how did you encounter these, ROM-walking?

Yep! Big Grin

A trusted tool of every Couch-Hacker...


RE: Mystery Prime commands - parisse - 09-23-2018 06:22 AM

These are indeed control words. fi is like end for a if, esac like end for case, etc.
otherwise is a default statement in a case structure.


RE: Mystery Prime commands - grsbanks - 09-23-2018 03:37 PM

(09-23-2018 06:22 AM)parisse Wrote:  These are indeed control words. fi is like end for a if, esac like end for case, etc.
otherwise is a default statement in a case structure.

Looks like some Unix shell scripting heritage creeping in Smile


RE: Mystery Prime commands - ijabbott - 09-23-2018 08:13 PM

(09-23-2018 03:37 PM)grsbanks Wrote:  
(09-23-2018 06:22 AM)parisse Wrote:  These are indeed control words. fi is like end for a if, esac like end for case, etc.
otherwise is a default statement in a case structure.

Looks like some Unix shell scripting heritage creeping in Smile

I first encountered 'elif', 'fi', and 'esac' in the Algol 68 language, so they predate the Bourne shell by about a decade.


RE: Mystery Prime commands - edryer - 09-29-2018 10:23 AM

try... catch is likely similar to the Java equivalent for error handling and recovery.