why is RPN always reversed (not PN)
|
05-25-2015, 07:44 AM
Post: #5
|
|||
|
|||
RE: why is RPN always reversed (not PN)
(05-25-2015 07:19 AM)StephenG1CMZ Wrote: To me, No - as Gerald H has pointed out, the RPN version is able to execute the operators immediately and has no need to store them. What you are really getting at is the notion of type safety and type promotion. In your example, you use the ADD or + operator, which might cause a syntax error when applied to strings. However, it might not if it really represents string concatenation and it can promote, say, a number higher on the stack to a string to allow that. And while the prefix version might detect the syntax error as soon as it sees the opening quote of the string, it might not - in fact, probably would not - see that quote until you've entered the entire quoted string, eliminating any keystrong advantage for the prefix approach. Generally, a line won't get parsed until the entire line has been entered by pressing "Enter", whether on a calculator-like device or on a computer keyboard. --- Les [http://www.lesbell.com.au] |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
why is RPN always reversed (not PN) - StephenG1CMZ - 05-25-2015, 06:14 AM
RE: why is RPN always reversed (not PN) - Thomas Radtke - 05-25-2015, 06:42 AM
RE: why is RPN always reversed (not PN) - StephenG1CMZ - 05-25-2015, 07:19 AM
RE: why is RPN always reversed (not PN) - Les Bell - 05-25-2015 07:44 AM
RE: why is RPN always reversed (not PN) - StephenG1CMZ - 05-25-2015, 12:23 PM
RE: why is RPN always reversed (not PN) - Gerald H - 05-25-2015, 07:11 AM
RE: why is RPN always reversed (not PN) - StephenG1CMZ - 05-25-2015, 12:04 PM
RE: why is RPN always reversed (not PN) - Didier Lachieze - 05-25-2015, 09:01 AM
RE: why is RPN always reversed (not PN) - Gerald H - 05-25-2015, 09:54 AM
RE: why is RPN always reversed (not PN) - ndzied1 - 05-25-2015, 10:59 AM
RE: why is RPN always reversed (not PN) - nlj - 05-25-2015, 11:44 AM
|
User(s) browsing this thread: 5 Guest(s)