newRPL: [UPDATED April 27-2017] Firmware for testing available for download
|
03-01-2017, 04:05 AM
Post: #579
|
|||
|
|||
RE: newRPL: [UPDATED February 21-2017] Firmware for testing available for download
(02-28-2017 08:46 PM)Han Wrote: That would work perfectly fine for a routine that checks each individual combination (lots of unnecessary tests in a general case). It was fairly common in the HP48 series to break up the testing based on the shift planes (and then the actual key). I vaguely recall that many parameterized outer loops had key handlers that broke up the cases based on the shifts. Testing by shift planes reduces the number of tests in the general-case and worst-case scenarios. It also helps organize the key definitions (by shift planes) better than a simple list that may or may not be organized. This makes perfect sense if you want to break it up, to access characters in a fixed position you'd have to use SUB, and if you get a real number you have to use FP. My proposal uses the separator for a reason: works well with the new NTHTOKEN command: Doing: "." 1 NTHTOKEN --> Isolate the key "." 2 NTHTOKEN --> Isolate the shift plane I think it's simpler than using SUB to get the key value and plane. Not simpler than IP/FP though (hard to beat that). (02-28-2017 10:54 PM)Vtile Wrote: One major or minor issue with the string based keycodes are the harware compatibility if someone at some point in the future is willing to port the newRPL to different HW, the named keys might not be there. It still will brake the UI of ported nRPL programs, but the row&column coding makes more sense (atleast as I see it now, but hmm..) in that regard. Let's think of the not-so-distant future when newRPL is ported to the Prime, for example. Let's look for example at the ENTER key. On the 50g it's at row 10, column 5, while the Prime has it at row 6, column 5. So you write your program that WAITs for the Enter key... then you'll have to release a Prime version and a 50g version just because of the keyboard mapping. However, with the string designation "EN" is Enter on both machines, regardless of where the key is physically located. Calculator keyboards will change in layout, but they all have numbers, operators, shifts, Enter, Backspace. Which alternative is more portable? It's true that some keys might vanish from one platform to another (right shift), some become the same key (like 7 and Q on the Prime) and some are completely new (Esc, View) but in general, it will be much easier to port an RPL program based on the string description of the key than on the row/column. (03-01-2017 01:05 AM)rprosperi Wrote: Regarding the keycodes, I have 2 comments: Platform independence will never be achieved on a command like WAIT that deals with the hardware. The idea is to make it easier to port from one platform to the other one. Independence can only be achieved if you map the keys on all new hardware to the same code that key had on the 50g keyboard. But then it won't mean row/column anymore so on the Prime you couldn't tell what's the Enter code unless you have a table printed in a book. (03-01-2017 01:05 AM)rprosperi Wrote: b. In many cases, newRPL has deviated from compatibility with RPL, but in every case I recall, there was some real benefit from the deviation, which justifies doing so (at least IMHO, there are no doubt folks here that want it 100% compatible, but then what's the point?). You don't see any benefit, hence your conclusion is correct. It would also be my conclusion if I didn't see any benefit, but I do: Let's say a typical routine that reads an integer number directly from the keyboard using WAIT. You'll be dealing with the numbers, Enter, Backspace, and perhaps cursors left and right. Such a routine would've needed changes even porting from a 48 to a 50g due to different keyboard layout. However, all those keys can be found on almost any calculator, so that newRPL program would run unmodified on practically any hardware. With row/column it would need a different version for each keyboard. (03-01-2017 01:05 AM)rprosperi Wrote: Claudio - you stated that the old-style key codes are hard to remember; I have to disagree as the point is you don't have to remember them at all, they are self-documenting by declaring their location in the key code itself. And while which plane is 1, 2, 3, etc. is not always memorized, it's no harder than the alphabet soup proposed, which in any case is mnemonic for English only. Do you still see no benefit? |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 7 Guest(s)