Post Reply 
newRPL: Making RPL more readable
12-18-2016, 04:11 AM (This post was last modified: 12-18-2016 12:42 PM by compsystems.)
Post: #25
RE: newRPL: Making RPL more readable
Hello,

1: coding on hp48/ 50 I always had problems to differentiate a variable from an algebraic expression.

X ^ 1 -> X is an algebraic expression and not a variable

I propose IDENTIFIER NAMES between the containers '' (39 ASCII)
AND ALGEBRAIC EXPRESSIONS between the containers ´´ (180 ASCII)

PHP Code:
'X' 'Y'  'Z'  'W' PURGE
´Y´ 
'X' STO
´Y
^2´ 'Z' STO
« 1 2 
» 'W' STO

'X' TYPE DOM_IDENTIFIER
X TYPE 
DOM_ALGEXPR
'X' RCL TYPE DOM_ALGEXPR

'Z' TYPE DOM_IDENTIFIER
Z TYPE 
DOM_ALGEXPR


'W' TYPE DOM_IDENTIFIER
'W' RCL TYPE DOM_PROGRAM 

2: Another problem is that the variables within a list when evaluated, if they contain the container '' should be left as is

A trick to keep it is labeling it
PHP Code:
CLEAR
'X' 'Y'  PURGE
'X' STO
} EVAL     @ 'Y' OK
'X' } EVAL   @ 'Y' =(, 'X' =)
{ ::
'X' } EVAL @  ::'X' OK
{ ::'X' } EVAL DTAG 'X' OK

« 1 2 
» 'W' STO
} EVAL     @ 3 OK
'W' } EVAL    @ 'W' OK

´Y
^2´ 'Z' STO
} EVAL     @ ´Y^2´ OK
'Z' } EVAL     @  'Z' OK

´Y^2´  } EVAL    @ ´Y^2´ OK
'Y' STO
´Y^2´  } EVAL  @ ´Y^2´ OK
´Y^2´ EVAL } EVAL  @ 16 OK 

3: So that the codes are auto-documented using keywords, for several constants

PHP Code:
TRUE EVAL @ -> 1
FALSE 
EVAL @ -> 0

DOM_REAL 
EVAL -> 1
DOM_INTEGER 
EVAL ->  1.2
DOM_BININTEGER 
EVAL ->  1.3
DOM_COMPLEX 
EVAL->  1.4
DOM_STRING 
EVAL -> 2
DOM_LIST 
EVAL -> 3
DOM_MATRIX 
EVAL -> 3.1
DOM_IDENTIFIER 
EVAL -> 4
DOM_ALGEXPR 
EVAL -> 5
DOM_UNIT 
EVAL -> 5.1
DOM_PROGRAM 
-> 6
DOM_DIR 
-> ...
... 

PHP Code:
IF 'W' RCL TYPE DOM_PROGRAM == THEN ... 
Instead of, that is not known that is #6
PHP Code:
IF 'W' RCL TYPE 6 == THEN .. 
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: newRPL: Making RPL more readable - Han - 12-02-2016, 12:39 PM
RE: newRPL: Making RPL more readable - Han - 12-07-2016, 07:37 AM
RE: newRPL: Making RPL more readable - Han - 12-07-2016, 10:12 PM
RE: newRPL: Making RPL more readable - Han - 12-05-2016, 07:43 PM
RE: newRPL: Making RPL more readable - compsystems - 12-18-2016 04:11 AM



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