Post Reply 
newRPL: Alpha demo 0.9 released [UPDATED 2017-10-25]
10-26-2017, 10:55 PM
Post: #212
RE: newRPL: Alpha demo 0.9 released [UPDATED 2017-10-25]
(10-26-2017 05:36 PM)The Shadow Wrote:  Here's an example of a newRPL program, a version of VISIT, that I haven't figured out how to do properly without changing a list into a program. If anyone can suggest a more efficient way I've missed, I'd welcome it:

<< DUP RCL IF DUP TYPE 28 == THEN DROP2 ELSE SWAP OVER "VISITBKUP" SDSTO { "EN" DELKEY STOXP } ADD LXP "EN" 0 ASNKEY "DN" KEYEVAL END >>

STOXP stands for STOre with eXtreme Prejudice, and will STO into a variable even if it is locked.

LXP is a name in the same spirit as AXL. It changes lists to programs and vice versa.

The only annoyance in this version of VISIT is that it seems to get the timing wrong at times, exiting the editor without having done DELKEY, leaving the edited object on the stack. If you press Enter again immediately, this will then store it properly. If you don't, you're asking for trouble, which is why I took the trouble of storing a backup on the SD card.

Likewise, if you exit the editor with ON, you'll have to press Enter immediately. It seems one can't add user keys to ON, which is probably wise, though unfortunate in this instance.

How about this way?
<< DUP RCL IF DUP TYPE 28 == THEN DROP2 ELSE SWAP OVER "VISITBKUP" SDSTO '.VisitVAR' STO '.VisitVAR' HIDEVAR << "EN" DELKEY IFERR '.VisitVAR RCL THEN ELSE STOXP '.VisitVAR' PURGE END >> "EN" 0 ASNKEY "DN" KEYEVAL END >>

And the proper way: just wait until I implement it! This really belongs in a built-in library.
Also, your program should create its own context, and replace the Enter key only inside that context, when the editor is active to avoid any interference with normal operation. Of course, there's still no commands to create your own context or change to it. Patience...
As you said, too many quirks for the time being.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: newRPL: Alpha demo 0.9 released [UPDATED 2017-10-25] - Claudio L. - 10-26-2017 10:55 PM



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