> Anybody knows any way to make an RPN calculator(like the HP calculators) in
> Maple.
Cool, a calculator user :)
This might be a start, although it's in Mathematica, not in Maple:
Sequence[2, 3] // Plus[##]&
Sequence[2, 3] // Times[##]&
--
Bhuvanesh,
Wolfram Research.
> Anybody knows any way to make an RPN calculator(like the HP calculators) in
> Maple.
>
>
How about forward Polish?
> `+`(3,4);
7
> `*`(3,4);
12
> `+`(`*`(3,4),7);
19
> Plus := `+`; Times := `*`;
Plus := +
Times := *
> Plus(Times(3,4),7);
19
> Plus(Times(x,y),z);
x y + z
> Times(Plus(x,y),z);
(x + y) z
> Plus(a,b,c,d);
a + b + c + d
> Times(u,v,w,x);
u v w x
--
G. A. Edgar http://math.ohio-state.edu/~edgar/
On Tue, 4 Jun 2002, G. A. Edgar wrote:
> In article <ad5n9u$ua3n4$6...@ID-88878.news.dfncis.de>, tm\
> <ma...@zipmail.com.br> wrote:
> > Anybody knows any way to make an RPN calculator(like the HP
> > calculators) in Maple.
> How about forward Polish?
> > `+`(`*`(3,4),7);
> 19
The cool thing about RPN is that it eliminates the need for parentheses.
We can do this Maple thus:
`&+`, `&-`, `&x`, `&/`:= `+`, `-`, `*`, `/`:
3,4:&x%,7:&+%;
19
a,b:&/%,c:&-%;
a/b-c
The history is ALMOST what I've wanted:
O1:= 30;
O2:= 40;
O3:= O1 + O2;
70
I am without maple to test now... formatted... cd drive damaged...
> --
> Bhuvanesh,
> Wolfram Research.