|RPN HP39gII : An attempt to summarize our discusion|
Message #1 Posted by Gilles Carpentier on 26 July 2012, 5:26 a.m.
The 24 of July, Tim Wessman was kind enough to ask us, HP calcs users, what could be RPN on something like a HP39gII , how would we like it done? What would be "absolutely critical"? What would be nice but not critical?
Here is (in my bad english) an attempt to summarize our discussion. Sorry for mistakes, errors or forgetting things...
« RPN HP39gII » : An attempt to summarize our discusion
1/ We want RPN !
Not surprisingly, all contributors think that RPN on a device like the HP39gII would be wonderfull. However for Patrice, it is first critical to fix operator prority on the present HP39gII ( modulo command).
2/ About the stack
Most persons who spoke on the subject prefer an infinite stack. Christian would prefer something like a 50G stack (infinite stack, and SPC or ENTER as separators, and no DUP on ENTER ). However Bill Wiese think the perfect programmable calculating device has bone-stock HP RPN with big ENTER key, XYZT+L registers, Z copy down etc.
No general idea emerges about what could be the stack manipulation commands (Nota : but it is an important topic, an infinite stack could not be manage as a finite stack – we must disuss this.
Gilles wrote that the "forth legacy" is fine for him, but perhaps more mnemotechnics commands could be interesting
(Nota : nobody wrote about the necessity of an interactive stack manipulation. But of course it is needed (cf HP50G Upper arrow)
3/ RPN vs RPL
As usual, 'classic RPN' vs 'RPL RPN' was in debate. Some find RPL too complex (Pal G ...), others find it simple to use and very powerfull (Oliver ...) Others (Wes Loewer...) find 'classic RPN' very hard to follow compared with RPL more easy to read. But Even those who like RPL wrote that there are some problems :
The lack of BREAK / CONTINUE
The use of LOCAL variables too heavy and unintiutive
For Eddy RPL and RPN are basically the same structure. Instead of commands like x>y?, LBL, GTO, R/S, and ISG in RPN, we have commands FOR-NEXT, WHILE-END, PROMPT, WAIT, and PAUSE in RPL. Both use objects in the stack and manipulate them to obtain desired results. Both are more challenging to read than say, a program written in BASIC.
4/ Programming vs interactive usage
RPN yes ! At least for interactive usage. But what about programming ?
Some people (Jim Horn, Christian …) wrote interactive use and programming aspect are quite different situations. So we could have RPN for interactive usage, and 'classic' 39gII language (no RPN entry) for programming. Gilles thinks it's not a good idea at all to have such a difference between the 2 modes (the power of a 50G/RPL is here !).
5/ About programming
X34 and other people think there is no need to have RPL, since what X34 called « Modula-39 » ;) is much more structured, orthogonal, simpler and more powerfull one. Gilles and Oliver wrote that you can do many things in RPL in a more easy way than in the 39gII embedded language.
All noted that the 39gII language is very readable and clear...Some wrote it must be improved (for example the lack of MAP command, retrieve the TYPE of a variable, List processing …)
Several people wrote that it's not a problem to have several languages on such a calc (like on the 50g)
Four ideas emerged about programming :
a/ RPN OK, but for interactive use only and keep the 39gII langage as it is. No need of RPN/RPL language
b/ RPL legacy. RPL is a powerfull and perfect language for a calc. Keep it ! Improve it !
c/ Classic RPN legacy. RPN 'classic' is a perfect tool for a Calc. We want it !
d/ HP39gII language is interesting and could be adapted to a Reverse polish notation with small efforts
Hummm... Do with this Tim ;)
6/ An alternative way : RPN and algebraic, Both for the same price !
Bill Wiese wrote that functions could run in postfix calc mode or prefix-with-arguments mode in BASIC.
Oliver (who create RPL+) show us we can mix in a smart way RPN/RPL and algebraics. Gilles also think so. The idea is to have a calc wich works _in the same time_ both in RPN and algebraic
IF sum>(n^2/log(10)) THEN … (no space => algebraic object)
IF sum n SQ 10 LOG / > THEN
The space (or no space) separator could be a key to differentiate RPN and Agebraic expression
So we could do :
45 SIN A *
SIN(45) A *
'SIN(X)' 'LOG(3*X)' * give 'SIN(X)*LOG(3*X)'
P1 P2 P3 Myfunction
A:=n^2/log(10) store in 'A'
n^2*log(10) just put the result value on the stack
=> A (or => 'A', or 'A' STO if we want RPL legacy) store in 'A'
n SQ 10 LOG * put each value on the stack applie functions and calulate
n² LOG(10) * will work also
Another way would be to use ' or ` to diffenciate RPN and algebraic part. (immediate and delayed evaluation).
Edited: 26 July 2012, 6:21 a.m. after one or more responses were posted