Hello BP
For RPN followers, please add a function that converts a mathematical expression to RPN, as a list of objects with RPN prefix to be able to identify this new type of data
toRPN( X ^ 2 + 3 ) [enter] to return
RPN[ 'X' 2 "^" 3 "+" ]
eval( RPN[ 'X' 2 "^" 3 "+" ] ) > X ^ 2 + 3
Thanks
toRPN() function cmd
Modérateur : xcasadmin
-
- Messages : 562
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: toRPN() function cmd
RPN support (in the parser) has been removed from Xcas since a long time, because nobody was using it (it seems RPN users are not interested in CAS). And this is understandable, because in RPN you can not easily reexec/modify a computation, and that's something you often do in a CAS.
-
- Messages : 562
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: toRPN() function cmd
I think the most complicated is the RPN interprete, but not the conversion of standard notation to RPN, at least incorporate toRPN(), but not eval(rpn object).
Another problem of the RPN is that a command interprets a number of fixed arguments, while the functional standard notation the number of arguments is variable
f1 (arg1, [arg2], [arg3], ...)
The following three options can be made
f1(arg1) [enter]
f1(arg1, arg2) [enter]
f1(arg1, arg2, arg3) [enter]
the only way in RPN is specifying in number of arguments, it can be with the symbols <-
arg1 f1 [enter]
arg1, arg2 f1←2 [enter]
arg1, arg2, arg3 f1←3 [enter]
Another problem of the RPN is that a command interprets a number of fixed arguments, while the functional standard notation the number of arguments is variable
f1 (arg1, [arg2], [arg3], ...)
The following three options can be made
f1(arg1) [enter]
f1(arg1, arg2) [enter]
f1(arg1, arg2, arg3) [enter]
the only way in RPN is specifying in number of arguments, it can be with the symbols <-
arg1 f1 [enter]
arg1, arg2 f1←2 [enter]
arg1, arg2, arg3 f1←3 [enter]
-
- Messages : 562
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: toRPN() function cmd
Mr. Bernard Parrise can please retrieve the library of the RPN interpreter, I think now with the enthusiasm of the newRPL project, this coding notation will be retaken
Thank you
Thank you
Re: toRPN() function cmd
I think it should be the other way around, if RPL users are also CAS-enthusiast, they should add CAS to newRPL or whatever.