(50g) Mirror the stack
03-19-2016, 02:23 PM (This post was last modified: 03-19-2016 02:24 PM by Vtile.)
Post: #1
 Vtile Senior Member Posts: 385 Joined: Oct 2015
(50g) Mirror the stack
Hello, late yesterday (or yearly today) I were toying with the 50g before going to sleep, well I entered long series of the number to the stack just to notice I entered them in reverse order. Then I tried to find a "stack mirror" function or script, without success so I created this UserRPL software to do it. I'm sure there is more sophisticated method of doing it, but here is one solution.

Provided as is, in the hope it is usefull. Public domain.

Code:
 << DEPTH Y → X Y  << 2 'Y' STO 2 X START Y PICK 2 Y + 'Y' STO NEXT X →LIST X ROLLD X 1 - DROPN OBJ→ DROP >> >>

- Vtile
03-19-2016, 02:50 PM (This post was last modified: 03-19-2016 05:48 PM by Gerald H.)
Post: #2
 Gerald H Senior Member Posts: 1,452 Joined: May 2014
RE: (50g) Mirror the stack
An efficient way on the 50g:

Enter number of elements you want to mirror & execute:

Code:
 :: CKN reversym UNCOERCE ;

Edited following rprosperi, posting #7.
03-19-2016, 03:01 PM
Post: #3
 Vtile Senior Member Posts: 385 Joined: Oct 2015
RE: (50g) Mirror the stack
What are these commands I can not find them from AUR?
03-19-2016, 04:38 PM (This post was last modified: 03-19-2016 04:40 PM by Tugdual.)
Post: #4
 Tugdual Senior Member Posts: 755 Joined: Dec 2013
RE: (50g) Mirror the stack
The Hp 50g supports two command sets: user RPL and system RPL.
The second has more commands and less checks making it faster than the first but also more prone to errors and possibly hard locks.
The second is also not documented in the user guide so you'll have the surf the wild wild web to get info.
You can do a lot already with user RPL, so wisely choose how you want to use your free time...
03-19-2016, 04:54 PM (This post was last modified: 03-19-2016 05:08 PM by Vtile.)
Post: #5
 Vtile Senior Member Posts: 385 Joined: Oct 2015
RE: (50g) Mirror the stack
(03-19-2016 04:38 PM)Tugdual Wrote:  The Hp 50g supports two command sets: user RPL and system RPL.
The second has more commands and less checks making it faster than the first but also more prone to errors and possibly hard locks.
The second is also not documented in the user guide so you'll have the surf the wild wild web to get info.
You can do a lot already with user RPL, so wisely choose how you want to use your free time...
That what I was suspecting, but I were on the (wrong) impression that AUR constains also SysRPL commands. I think I stay away from it. UserRPL mirror does mirror 1000 stack entries in about 6½ seconds and 2000 entries before I can get new cup of coffee, so there is no need for me for more speed. Edit.. It seems calculator starts to "fail" above 1k high stack, not bad.

Anyway thx, Gerald H. for sysRPL version.
03-19-2016, 05:08 PM
Post: #6
 Tugdual Senior Member Posts: 755 Joined: Dec 2013
RE: (50g) Mirror the stack
You might also consider entering the values in the right order.
This is even faster than swapping the stack...
03-19-2016, 05:23 PM
Post: #7
 rprosperi Senior Member Posts: 4,472 Joined: Dec 2013
RE: (50g) Mirror the stack
(03-19-2016 02:50 PM)Gerald H Wrote:  An efficient way on the 50g:

Enter number of elements you want to mirror & execute:

Code:
 :: CKN reversym UNCOERCE ::

A minor nit, but the closing "::" should be simply ";"
But a really good example of the power and elegance of SysRPL, thanks Gerald.

--Bob Prosperi
03-19-2016, 05:53 PM
Post: #8
 Vtile Senior Member Posts: 385 Joined: Oct 2015
RE: (50g) Mirror the stack
(03-19-2016 05:08 PM)Tugdual Wrote:  You might also consider entering the values in the right order.
This is even faster than swapping the stack...
Naturally, the 50g is missing this kind of command though. "Pick a block" would be even better command for scratch book use (half braindead mode ), maybe I should propose it for the newRPL crew.
03-19-2016, 06:13 PM
Post: #9
 Tugdual Senior Member Posts: 755 Joined: Dec 2013
RE: (50g) Mirror the stack
(03-19-2016 04:54 PM)Vtile Wrote:
(03-19-2016 04:38 PM)Tugdual Wrote:  The Hp 50g supports two command sets: user RPL and system RPL.
The second has more commands and less checks making it faster than the first but also more prone to errors and possibly hard locks.
The second is also not documented in the user guide so you'll have the surf the wild wild web to get info.
You can do a lot already with user RPL, so wisely choose how you want to use your free time...
That what I was suspecting, but I were on the (wrong) impression that AUR constains also SysRPL commands. I think I stay away from it. UserRPL mirror does mirror 1000 stack entries in about 6½ seconds and 2000 entries before I can get new cup of coffee, so there is no need for me for more speed. Edit.. It seems calculator starts to "fail" above 1k high stack, not bad.

Anyway thx, Gerald H. for sysRPL version.
This is a pretty good introduction to sysRPL.
03-19-2016, 06:32 PM (This post was last modified: 03-19-2016 06:34 PM by Claudio L..)
Post: #10
 Claudio L. Senior Member Posts: 1,709 Joined: Dec 2013
RE: (50g) Mirror the stack
(03-19-2016 05:53 PM)Vtile Wrote:
(03-19-2016 05:08 PM)Tugdual Wrote:  You might also consider entering the values in the right order.
This is even faster than swapping the stack...
Naturally, the 50g is missing this kind of command though. "Pick a block" would be even better command for scratch book use (half braindead mode ), maybe I should propose it for the newRPL crew.

Code:
 << DEPTH →LIST REVLIST OBJ→ DROP >>
03-19-2016, 06:38 PM (This post was last modified: 03-19-2016 06:42 PM by Vtile.)
Post: #11
 Vtile Senior Member Posts: 385 Joined: Oct 2015
RE: (50g) Mirror the stack
too simple. I see it were the REVlist that I were searching.. Half an hour weren't enough to come up with that from AUR.

Rev .. Reverse naturally, dang.
 « Next Oldest | Next Newest »

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