Post Reply 
Simple programming help with the Prime
06-09-2014, 06:34 PM
Post: #5
RE: Simple programming help with the Prime
Tim,

To me, in the context of an RPN machine, the answers to these questions seem pretty obvious. Also obvious is that I don't understand all of the complexities you're operating under. In any case, fairly asked. Here are my answers:
(06-09-2014 05:13 PM)Tim Wessman Wrote:  So how would you propose handling cases where you can have any number of arguments such as the MIN function which can take 1-16? Limit it to 2 and lose functionality?
If the MIN function takes as an argument the number of objects to compare, then that number should be placed on the stack prior to invoking MIN. RPN is (almost completely) postfix and any temptation to make the operator infix under certain circumstances should be resisted. The current implementation seems to me to be more for the convenience of making the menus more similar between RPN and Algebraic entry modes.
(06-09-2014 05:13 PM)Tim Wessman Wrote:  How would you avoid automatic evaluation when selecting it from a menu in RPN mode and it would automatically take 2 numbers instead of the 5 you wanted?
Note that this is a problem that's caused because of the decision to include an operand after the operator as described above. If the case above were implemented more in the true spirit of RPN, then this problem vanishes.
(06-09-2014 05:13 PM)Tim Wessman Wrote:  What about in the CAS where something like sin(1,2,3,4) is a perfectly valid input?
Not trying to be too glib here, but since CAS is not RPN or stack oriented, this seems like it's outside the domain we were discussing. Not that I don't want a true RPN CAS mode, but then that probably obviates the needs for CAS vs. Home, doesn't it?

- John
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Simple programming help with the Prime - John R. Graham - 06-09-2014 06:34 PM



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