DB48X: HP48-like RPL implementation for DM42
|
09-04-2024, 04:58 PM
Post: #286
|
|||
|
|||
RE: DB48X: HP48-like RPL implementation for DM42
(09-04-2024 03:37 PM)grbrum Wrote: Hello Christophe, do you plan on implementing DOSUBS command? Or is there another command that I can use as alternative? I plan to implement all the non-system features of the HP48. DOSUBS is part of it. As a matter of fact, I was looking at it recently, and started studying how to actually implement it. Having someone asking for it definitely bumps the priority up. Right now, here are some tools you can use that play a similar role: 1/ MAP / REDUCE / FILTER. I used the now traditional terminology for these operations. The HP48 calls REDUCE "STREAM", and that alias is accepted. I don't think that RPL has a direct equivalent to FILTER, which is used to build a list from items for which a predicate is true. For example, to filter only odd values in a list, you can use { 1 2 3 5 6 7 8 11 9 } << 2 MOD >> FILTER, and you get { 1 3 5 7 11 9 }. 2/ FOR loop with a list input. For example 0 { A B C D E } FOR I I 2 * 1 + + NEXT returns 2*A+2*B+2*C+2*D+2*E+5 (assuming none of the variables is defined). Part of the problem I have with DOSUBS and DOLIST is the special treatment they make of commands based on the number of arguments that they take. I have the infrastructure in DB48X to replicate that functionality, but it will take a lot of testing with the HP48 and HP50 to see how that behaves on real HP machines. People who use DOSUBS tend to know what they are doing ;-) ⚙️,?,? |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 35 Guest(s)