Post Reply 
Mystery Prime commands
09-22-2018, 10:16 PM
Post: #1
Mystery Prime commands
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

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
09-22-2018, 11:56 PM
Post: #2
RE: Mystery Prime commands
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".
Visit this user's website Find all posts by this user
Quote this message in a reply
09-23-2018, 01:22 AM
Post: #3
RE: Mystery Prime commands
(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?

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
09-23-2018, 01:38 AM
Post: #4
RE: Mystery Prime commands
(09-23-2018 01:22 AM)rprosperi Wrote:  @Joe - how did you encounter these, ROM-walking?

Yep! Big Grin

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
09-23-2018, 01:45 AM
Post: #5
RE: Mystery Prime commands
(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...

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
09-23-2018, 06:22 AM
Post: #6
RE: Mystery Prime commands
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.
Find all posts by this user
Quote this message in a reply
09-23-2018, 03:37 PM
Post: #7
RE: Mystery Prime commands
(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
Find all posts by this user
Quote this message in a reply
09-23-2018, 08:13 PM
Post: #8
RE: Mystery Prime commands
(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.

— Ian Abbott
Find all posts by this user
Quote this message in a reply
09-29-2018, 10:23 AM
Post: #9
RE: Mystery Prime commands
try... catch is likely similar to the Java equivalent for error handling and recovery.

HP-28S (1988 US model), Sharp EL 9900 (2000), Casio FX-992S (1995)
Find all posts by this user
Quote this message in a reply
Post Reply 




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