toRPN() function cmd

Messages in english

Modérateur : xcasadmin

compsystems
Messages : 562
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

toRPN() function cmd

Message par compsystems » ven. avr. 12, 2019 1:49 pm

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

parisse
Messages : 5739
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: toRPN() function cmd

Message par parisse » ven. avr. 12, 2019 2:26 pm

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.

compsystems
Messages : 562
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: toRPN() function cmd

Message par compsystems » ven. avr. 12, 2019 4:17 pm

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]

compsystems
Messages : 562
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: toRPN() function cmd

Message par compsystems » jeu. avr. 18, 2019 1:32 pm

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

parisse
Messages : 5739
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: toRPN() function cmd

Message par parisse » jeu. avr. 18, 2019 6:43 pm

I think it should be the other way around, if RPL users are also CAS-enthusiast, they should add CAS to newRPL or whatever.

Répondre