Post Reply 
DB48X: HP48-like RPL implementation for DM42
09-04-2024, 06:14 PM
Post: #287
RE: DB48X: HP48-like RPL implementation for DM42
(09-04-2024 04:58 PM)c3d Wrote:  
(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?

Thank you

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 ;-)


Thank you, I use it to perform iterate calculation using consecutive items in the list. I have a program that I use daily where I can add any number of items in the stack, it will make a list and perform a calculation between the numbers.

example to calculate circle area reduction if input is sequence of diameter of circle.
DRAFT
« DEPTH
→LIST 2
« / INV 2
^ 1 -
» DOSUBS
OBJ→ DROP 4 FIX
»

I have a series of programs that follows the same idea and performs different calculations.

thank you.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
DB48X v0.4.8 is out - c3d - 10-22-2023, 11:31 PM
Release v0.5.0: Statistics and flags - c3d - 11-20-2023, 08:57 AM
v0.6.5: Minor bug fixes - c3d - 02-11-2024, 11:23 PM
Release 0.7.1 "Whip" - Bug fixes - c3d - 03-04-2024, 12:46 AM
DB48X v0.7.4 release is out - c3d - 04-14-2024, 03:05 PM
DB48X v0.7.6: Solving menu - c3d - 05-13-2024, 12:04 AM
DB48X v0.7.7: Units in solver - c3d - 06-02-2024, 11:36 PM
v0.7.10 - Interactive stack - c3d - 07-14-2024, 11:31 PM
DB48X v0.7.13 is out - c3d - 08-05-2024, 07:31 AM
DB48X v0.7.15 - c3d - 08-25-2024, 08:45 PM
DB48X v0.7.16 - c3d - 09-02-2024, 01:36 AM
DOSUBS command - grbrum - 09-04-2024, 03:37 PM
RE: DB48X: HP48-like RPL implementation for DM42 - grbrum - 09-04-2024 06:14 PM
v0.7.18 - APPLY, SUBST, WHERE - c3d - 09-15-2024, 11:58 PM
Program Editing Question - spiff72 - Yesterday, 03:27 PM



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