Post Reply 
DB48X: HP48-like RPL implementation for DM42
10-01-2024, 09:38 PM
Post: #321
RE: DB48X: HP48-like RPL implementation for DM42
(10-01-2024 10:49 AM)tdh79 Wrote:  
(07-10-2023 12:07 AM)Helix Wrote:  As I find RPL superior to RPN, this project could justify the purchase of a DM42. Smile
And I like very much the interface!

I have some basic questions:
- how to quickly access the variables menu? I don’t remember seeing it in the video.
- will comments be possible inside programs, apart from the inelegant "text" DROP ?
- will list processing be available, like in the HP48 G/GX or the HP50G?
- I know it’s very premature, but if variable floating-point precision is implemented some day, will it replace the fixed floating-point precision library? I don’t like the idea of scarifying speed to gain useless precision.

RPL different from RPN? I thought one was a programming language and the other a method for inputting data?

In contexts where you contrast them, it's typically to oppose "keystrokes" programmable calculators, called "RPN", to the Reverse Polish Lisp ROM Programming Language known as RPL. It's also to distinguish calculators with a 4-level XYZT stack that fills with T when you consume values from later RPL models where the stack can grow arbitrarily and errors out if empty. Historically, RPL also implies support for algebraic and symbolic expression evaluation, named variables, structured loops, and a wide variety of data types.

RPL descends from RPN, and some simple RPN keystroke programs translate quite naturally into RPL. Anything that involves GTO/LBL loops or worse yet the horrible ISG/DSE instructions will definitely be harder to convert from RPN keystrokes to RPL :-)

DB48X,HP,me
Find all posts by this user
Quote this message in a reply
10-02-2024, 03:30 PM
Post: #322
RE: DB48X: HP48-like RPL implementation for DM42
@c3d
I think I found a bug dividing 1100 by 2.2 = 5,000,000
version 0.8.0Z

if I divide 1100.00000,00000,1 by 2.2 = 500

thanks
Find all posts by this user
Quote this message in a reply
10-02-2024, 04:30 PM (This post was last modified: 10-02-2024 04:32 PM by c3d.)
Post: #323
RE: DB48X: HP48-like RPL implementation for DM42
(10-02-2024 03:30 PM)grbrum Wrote:  @c3d
I think I found a bug dividing 1100 by 2.2 = 5,000,000

Wow!

The good news is that I cannot reproduce on any of my devices (I tried DM32, DM42, iOS, Linux and macOS simulators, all gave the correct answer).

The bad news (for me) is that I trust you, so I suspect a display problem. We can check that quickly by calling LOG on the result you see, and checking if you get something closer to 2.7 or to 6.7. If you get 6.7, then it means the result was actually wrong. If you get 2.7, it means that the result was correct but displayed incorrectly.

Based on you typing 5,000,000, I suspect that you are using different settings for display, which might explain why I don't see it. Can you save the state file and share that with me? Also, what platform did you observe this on (DM32, DM42, DM42n, iOS, simulator)?

Quote:version 0.8.0Z

How the heck did you get a Z release? Did you build it yourself? Or did I actually publish a Z release by mistake?

To be clear, the Z indicates that this was built from a dirty source state (e.g. some files not committed), which is totally unexpected for a release. This means that I have no idea what you are running Sad Maybe send the binaries back to me?

I have occasionally made the mistake of copying a Z release file to GitHub, e.g. because there was a last-minute change in the documentation, typically release notes, that I had forgotten to commit. I did this specific mistake for the 0.8.0 release, but I thought I had fixed before actually publishing it.

I just downloaded the file from GitHub and reinstalled, just to make sure, and my DM32 shows v0.8.0. If GitHub shared a v0.8.0Z with you, then I'd really like to understand why. This might suggest that updating a release binary on GitHub to fix a mistake is not instantaneous, or simply that you were unlucky enough to download a transitory 0.8.0Z before I saw my mistake and replaced it with the correct 0.8.0.

That being said, I seriously doubt "my" 0.8.0Z would be the source of your problem, as it was just a couple of lines changed in the release note.

Quote:if I divide 1100.00000,00000,1 by 2.2 = 500

thanks

I assume this is 500. (i.e. decimal)?

DB48X,HP,me
Find all posts by this user
Quote this message in a reply
10-02-2024, 05:54 PM
Post: #324
RE: DB48X: HP48-like RPL implementation for DM42
(10-02-2024 04:30 PM)c3d Wrote:  I just downloaded the file from GitHub and reinstalled, just to make sure, and my DM32 shows v0.8.0. If GitHub shared a v0.8.0Z with you, then I'd really like to understand why. This might suggest that updating a release binary on GitHub to fix a mistake is not instantaneous, or simply that you were unlucky enough to download a transitory 0.8.0Z before I saw my mistake and replaced it with the correct 0.8.0.

I downloaded DB48X 0.8.0 from github on Monday 30th (sorry, forgot the exact time but I think it was around 20:00 CET), and apparently my DM42 now also has 0.8.0Z...

I've downloaded the archive again (didn't keep the old one), but the date of "db48x.pgm" differs with that on the FAT system of the calculator:

0.8.0Z: db48x.pgm - 2024-09-29 21:02 CET
0.8.0: db48x.pgm - 2024-09-30 22:51 CET (that's more recent than when I first downloaded 0.8.0)

I could not reproduce the 1100/2.2 bug with 0.8.0Z, though.
Find all posts by this user
Quote this message in a reply
10-02-2024, 06:15 PM
Post: #325
RE: DB48X: HP48-like RPL implementation for DM42
Hello, thank you for the trust Smile

To spare you the full read, I changed the state to DEMO and the problem does not occur anymore, sorry about the inconvenience.
my test state only has a couple of programs and the following lines in the end:

NoTrailingDecimal
4 Fix
4 DisplayDigits
Dec
NumberDotOrComma
8 WordSize
HomeDirectory

I deleted everything above HomeDirectory and the problem is solved. all is good now
since I tried this last, I had already written the comments below.

Quote:The bad news (for me) is that I trust you, so I suspect a display problem. We can check that quickly by calling LOG on the result you see, and checking if you get something closer to 2.7 or to 6.7. If you get 6.7, then it means the result was actually wrong. If you get 2.7, it means that the result was correct but displayed incorrectly.

I get 2.7

Quote:Based on you typing 5,000,000, I suspect that you are using different settings for display, which might explain why I don't see it

I actually get 5000000. then I put 5 million on the stack, I get the following:
2| 5000000
1| 5,000,000
if I do LOG on 5,000,000 I get 6.7, if I do LOG on 5000000 I get 2.7.

Quote:How the heck did you get a Z release? Did you build it yourself? Or did I actually publish a Z release by mistake?
[/php]
I checked again, in VERSION, this is the version number 0.8.0Z - running on DM42.

I downloaded it yesterday in the afternoon (~12:30 PM Central USA) - db48x-v0.8.0.tgz - I can share with you the binary, via email is better?

Quote:I just downloaded the file from GitHub and reinstalled, just to make sure, and my DM32 shows v0.8.0. If GitHub shared a v0.8.0Z with you, then I'd really like to understand why. This might suggest that updating a release binary on GitHub to fix a mistake is not instantaneous, or simply that you were unlucky enough to download a transitory 0.8.0Z before I saw my mistake and replaced it with the correct 0.8.0.

That being said, I seriously doubt "my" 0.8.0Z would be the source of your problem, as it was just a couple of lines changed in the release note.

I tried reinstalling the binary I downloaded yesterday and version 0.8.0Z is still loaded, and indeed downloading it again I now get version 0.8.0.
And you are right, the new version 0.8.0 still presents the problem.
Find all posts by this user
Quote this message in a reply
10-02-2024, 06:27 PM
Post: #326
RE: DB48X: HP48-like RPL implementation for DM42
Still whatever was wrong with my state file, it is still interesting that this error only happened with 1100 / 2.2
I also tried 1000/2.2 ; 900/2.2; 1200/2.2; 1100/2 and all return expected results.
only 1100/2.2 gave a weird display result.

by means of elimination, the error is on the NoTrailingDecimal line.

below is the test state file which was giving error:
«
Depth →List 2
«
÷ x⁻¹ 2 ↑ 1 -
»
DoSubs Object→ Drop
4 FixedDisplay
»
'Draft' STO

«
→ a b
«
4 FixedDisplay
if
b 1 <
then
a 1 b - ÷ "SP" →Tag
else
a b b a - b ÷ "Margin"
→Tag b a - "Contribution"
→Tag
end
»
»
'Margin' STO

«
→ i o
«
if
o 0 >
then
o i ÷ x² 1 - o
else
i o 1 + √ i ×
end
»
»
'Reduction' STO

NoTrailingDecimal
4 Fix
4 DisplayDigits
Dec
NumberDotOrComma
8 WordSize
HomeDirectory
Find all posts by this user
Quote this message in a reply
10-03-2024, 01:17 AM (This post was last modified: 10-03-2024 01:20 AM by c3d.)
Post: #327
RE: DB48X: HP48-like RPL implementation for DM42
(10-02-2024 06:27 PM)grbrum Wrote:  Still whatever was wrong with my state file, it is still interesting that this error only happened with 1100 / 2.2

It actually happens if you manually enter 500.0 or 500. on the command line, i.e. the problem is with the value 500.

I found and fixed the problem. You correctly attributed it to the NoTrailingDecimal setting. The elimination of the trailing . was triggered, which caused it to, internally, write 500, suppressing the . because there were no non-zero digits left to display, then write 0000 to respect the FIX 4 setting.

If you select FIX 2, then you get 50000, and so on.

Note that the internal representation for variable-size decimals uses a dense binary-decimal encoding, where 10 bits store three decimal digits (values 0-999, the values 1000-1023 being "lost"). As a result, the problem does not occur for 50.0 or 5.0, you need at least 3 digits for it to actually trigger.

Quote:I also tried 1000/2.2 ; 900/2.2; 1200/2.2; 1100/2 and all return expected results.
only 1100/2.2 gave a weird display result.

It's because all these other values have trailing decimals, except the 1100/2 calculation, which was done using only integers. If you had typed 1100/2. or 1100./2, i.e. with a decimal separator on either side, you get the same problem with 5500000 being shown.

Quote:by means of elimination, the error is on the NoTrailingDecimal line.

You are entirely correct.

Thanks a lot for the report, this will be fixed in the next release.

DB48X,HP,me
Find all posts by this user
Quote this message in a reply
10-04-2024, 05:00 AM (This post was last modified: 10-04-2024 05:02 AM by grbrum.)
Post: #328
CST Custom Menu
Hello @c3d,
what are your thoughts about implementing a CST (HP48 like) menu within VAR?

The current VAR menu uses a lot of screen real-estate having the <<variable>> in the first line, then Variable> in the second and >variable in the third, but for programs, it is not common to use the shifted options in a day to day. As more programs are added, the older programs are shifted to the next screen and so on. It is not too convenient.

the Var menu contains programs but also variables and other objects, I had an idea that with one click VAR it could open a 3x6 menu grid (for F1-F6, shifted and double shifted) with your favorite programs (like WP43/C47), and with double click VAR, it enters the current VAR menu.
You reassigned the ASN key to "as number", but maybe it can have double function,
example, if in VAR menu, ASN could assign the program/variable to one of the CST locations.

I read the change notes and I know you are implementing the Library as CST, when I loaded the library files in the DM42, they are all in one folder, but they show in the calculator under sub menus, I am not sure how this is organized and how to customize it. maybe this is where this is going and you can shed some light.

I guess that my idea of using VAR as one or two clicks is more practical to access the programs, rather than using a shifted key.

I am interested in your thoughts.
thanks for the amazing work.
Find all posts by this user
Quote this message in a reply
10-06-2024, 09:34 AM
Post: #329
RE: DB48X: HP48-like RPL implementation for DM42
Just chiming in to say that I installed DB50x on my new DM42n and everything seems to work as expected so far.
Find all posts by this user
Quote this message in a reply
10-07-2024, 05:26 PM (This post was last modified: 10-07-2024 07:26 PM by c3d.)
Post: #330
RE: DB48X: HP48-like RPL implementation for DM42
(10-04-2024 05:00 AM)grbrum Wrote:  Hello @c3d,
what are your thoughts about implementing a CST (HP48 like) menu within VAR?

The current VAR menu uses a lot of screen real-estate having the <<variable>> in the first line, then Variable> in the second and >variable in the third, but for programs, it is not common to use the shifted options in a day to day. As more programs are added, the older programs are shifted to the next screen and so on. It is not too convenient.

It depends on what you are doing. When primarily using programs, which is the use case you describe, then it may be a bit inconvenient, and then only inasmuch as it gives you access to at most 6 programs at a time vs 18. While editing a program, on the other hand, or using global variables for numerical values or to recall and store things (which is the primary purpose of the VAR menu), it's quite handy to have quick shortcuts to recall and store into each variable.

Quote:the Var menu contains programs but also variables and other objects, I had an idea that with one click VAR it could open a 3x6 menu grid (for F1-F6, shifted and double shifted) with your favorite programs (like WP43/C47), and with double click VAR, it enters the current VAR menu.

I have indeed considered adding a custom menu (that's issue #433), and I did consider using VAR VAR to access it. At the moment, the Library menu presents a relatively usable alternative to a custom menu, so the urgency of this particular matter went down a bit. See also discussion of user mode below.

Now, what could be done is to have VAR alternate between "programs only" and "all variables" modes, where the "programs only" mode would only let you evaluate programs, but then could show up to 18 programs at a time. Is that what you are suggesting?

Quote:You reassigned the ASN key to "as number", but maybe it can have double function,
example, if in VAR menu, ASN could assign the program/variable to one of the CST locations.

The HP48 has both a custom menu (CST) and a user mode (USR). Those are different ways to customize the calculators, one applying to menus only, the other to the entire keyboard. I intend to preserve that distinction, and the USER menu will deal with whole-keyboard customization.

The ASN key is used for key assignment on the DM42, and I initially kept it that way in DB48X. But on HP48, it is not a primary key, it's in the MODES menu, and when I realized that I had forgotten to find a spot for "->Num", I repurposed ASN with the "as number" mnemonic. I finally updated the keyboard layout images to match that. ->NUM is too important in daily use on an RPL machine to not have a primary key. Its priority on the keyboard is definitely way above ASSIGN.

As for how user mode will work, this is currently at the planning stage. My current thinking is that it will be extremely similar to how the HP48 does it, i.e. it will give you the ability to redefine any key in any of the major entry modes (shifted, unshifted, alpha, etc). The two differences I have in mind are:

1) There would be a config/keyboard.csv configuration file that you could use to override any key, including outside of user mode. So if you dislike my personal choice to make ->Num a primary key on Shift-1, and prefer to have "ASSIGN" there, it will be possible.

2) User-mode key assignment would be stored in a regular variable, so that you could have different assignments in different directories.



Quote:I read the change notes and I know you are implementing the Library as CST, when I loaded the library files in the DM42, they are all in one folder, but they show in the calculator under sub menus, I am not sure how this is organized and how to customize it. maybe this is where this is going and you can shed some light.

The DB48X library is probably the best alternative to the CST menu today. While most of the content now is actually defined by files in the library/ folder, the actual definition of the LIB menu is in config/library.csv. Let me know if you have trouble understanding how that file is organized. Entries that contain only "=" load the corresponding file in library/.

For example, the two submenus with name "Physics" and "Mathematics" in the library are defined with:

Code:
"Physics"

    "KineticEnergy",    "="

"Mathematics"

    "CollatzBenchmark",    "="
    "CollatzConjecture",    "="
    "CountPrimes",        "="
    "TriangleEquations",    "="

The actual definitions of something like "CollatzBenchmark" is in a file named library/CollatzBenchmark.48s, which contains (comments removed):

Code:
«
         «
              989345275647 ⓁCollatzConjecture
         »
         TEVAL
»



Quote:I guess that my idea of using VAR as one or two clicks is more practical to access the programs, rather than using a shifted key.

Why would you need to access a shifted key to access the programs? The current VAR menu evaluates programs when unshifted, and you recall the program with shift. CST (and the library) evaluate the program as well. So I am not sure that I understand this particular point.

Quote:I am interested in your thoughts.
thanks for the amazing work.

DB48X,HP,me
Find all posts by this user
Quote this message in a reply
10-07-2024, 05:28 PM
Post: #331
RE: DB48X: HP48-like RPL implementation for DM42
(10-06-2024 09:34 AM)dmjb Wrote:  Just chiming in to say that I installed DB50x on my new DM42n and everything seems to work as expected so far.

Good news, thanks for reporting.

According to this poll, there are already 7 users of DB48x on DM42n. This is great news.

DB48X,HP,me
Find all posts by this user
Quote this message in a reply
10-08-2024, 03:18 AM
Post: #332
RE: DB48X: HP48-like RPL implementation for DM42
Hi Christophe, thank you for the thoughtful and engaging answers.

Quote:Now, what could be done is to have VAR alternate between "programs only" and "all variables" modes, where the "programs only" mode would only let you evaluate programs, but then could show up to 18 programs at a time. Is that what you are suggesting?

Separating programs from variables may not be the best solution, as you know programs can be used as subroutines for other programs and these are sometimes useful to be "hidden"or in the background, where the main program is useful to be in the forefront for easy access.
This is why I suggest a hybrid of CST/ASN solution.
Say you press VAR once, then you get to the normal VAR menu, with all VAR contents (in the future I guess you will implement directories)...
Say you press VAR VAR, then this can show only the items (programs or variables that the user decides to assign to those 18 blocks (or you can set F6 to change page).
this solution will give some advantages:
1 - the user decides what goes there
2 - the user decides the position of each program in the grid, maybe one program makes sense to stay next to another (in my case, chemical reaction programs can stay in the first page, cost and price calculation in the second page, finance in the third page, special conversion programs in a forth page)
3 - subroutine programs will not be in this VAR VAR menu even though they are <<>> programs.

Quote:The ASN key is used for key assignment on the DM42, and I initially kept it that way in DB48X. But on HP48, it is not a primary key, it's in the MODES menu, and when I realized that I had forgotten to find a spot for "->Num", I repurposed ASN with the "as number" mnemonic. I finally updated the keyboard layout images to match that. ->NUM is too important in daily use on an RPL machine to not have a primary key. Its priority on the keyboard is definitely way above ASSIGN

I agree, in my overlay it is still ASN... it was an oversight.
other options can be considered, for instance, in the VAR menu, if you hold the soft key representing the program, you get the help menu, but is is possible to implement a 2 step process, hold for a second and you get assign, hold for 4 seconds and you get help (just an idea)

Quote:The DB48X library is probably the best alternative to the CST menu today. While most of the content now is actually defined by files in the library/ folder, the actual definition of the LIB menu is in config/library.csv.

I failed to notice this detail, I saw in the Shift Shift VAR the config folder and thought cumbersome to try to edit that. I didn't notice it was one of the files in config/
I see the file structure you mention and I will review it, but I do not have the calculator on me while I am on this business trip. Thanks for the tips you shared with me. I will look into it and reply when I return to the office.

Quote:
Quote:I guess that my idea of using VAR as one or two clicks is more practical to access the programs, rather than using a shifted key.

Why would you need to access a shifted key to access the programs? The current VAR menu evaluates programs when unshifted, and you recall the program with shift. CST (and the library) evaluate the program as well. So I am not sure that I understand this particular point.

This was assuming that the CST would be the LIB, then it would be necessary to use shift shift var in order to reach the program in a structure that is user defined.
As VAR follow same principle of HP48, where new programs are added to the left of the row and the older programs are shifted right and off to the next screen, some of these older programs are sometimes used frequently and should be front and center to the user. Which brings me now to another idea (sorry).
Maybe one VAR should show only the favorite programs/variables in the order of the user preference, and VAR VAR could show the possibility to call/reassign value to the variable (as it is today).

Anyway, I just want to contribute ideas as an enthusiast. I am not a programmer and my abilities to program in RPL are also limited. I am just very excited about this project because I used my HP48 during my college years and beyond, and I use the DB48x every day now at work.

Thanks again.
Find all posts by this user
Quote this message in a reply
10-10-2024, 05:02 PM
Post: #333
RE: DB48X: HP48-like RPL implementation for DM42
(10-08-2024 03:18 AM)grbrum Wrote:  This is why I suggest a hybrid of CST/ASN solution.
Say you press VAR once, then you get to the normal VAR menu, with all VAR contents (in the future I guess you will implement directories)...

It's been implemented a while ago (August 7, 2023). And the demo file is now made of two levels of directories.

Quote:Say you press VAR VAR, then this can show only the items (programs or variables that the user decides to assign to those 18 blocks (or you can set F6 to change page).

OK, so you are suggesting some a VAR/CST alternance. That makes sense.

Quote:other options can be considered, for instance, in the VAR menu, if you hold the soft key representing the program, you get the help menu, but is is possible to implement a 2 step process, hold for a second and you get assign, hold for 4 seconds and you get help (just an idea)

I'm not sure if you mean "assign" as in "assign a key" or as in "assignment" (i.e. the STO command). I don't want a same key to recall a value or store it depending on how long you press it. That seems super-dangerous. Furthermore, the long-press gives help just resurrects a very old HP tradition, that you see for example in the HP41, where a long press shows the name of the command before cancelling it. That mechanism did not exist on the HP48, and I missed it.

Showing help is similar to showing the name of the command, and it also has the side effect of cancelling execution.

Quote:This was assuming that the CST would be the LIB, then it would be necessary to use shift shift var in order to reach the program in a structure that is user defined.
As VAR follow same principle of HP48, where new programs are added to the left of the row and the older programs are shifted right and off to the next screen, some of these older programs are sometimes used frequently and should be front and center to the user.

There is an ORDER command in RPL to reorder variables.
The bad news is that it's not implemented yet on DB48x. Soon. ish.

DB48X,HP,me
Find all posts by this user
Quote this message in a reply
10-15-2024, 07:21 AM (This post was last modified: 10-15-2024 08:01 AM by c3d.)
Post: #334
Pre-release 0.8.1 - Multiple equation solver
I just posted pre-release 0.8.1. Please give it a try.

The primary focus of this release is to support the work on the equation library done by Jean Wilson, notably with the introduction of a multiple-equation solver, the possibility to load code examples from the built-in help (which was also accelerated), and support of copy-paste in the simulator. The solver work is not finished. The MSLV (multiple simultaneous equation) solver is not implemented, and I am unsatisfied with the current behaviour of the simple solver when there are no roots (it does not converge quickly enough towards an extremum).

Additional improvements are suggestions by users, notably support for polar, spherical and cylindrical vectors, faster typing for Greek and Cyrillic, and quick edit commands using transient alpha with function keys. There is also a fix for the display bug causing 500.000 to display as 500000 (reported by grbrum) and a fix for a precision problem for arctan for inputs between 0.5 and 1.0.

Like for complex numbers, spherical and cylindrical vectors are not just a display artefact controlled by some flag, so that the stack can contain a mix of cylindrical, spherical and rectangular vectors.

The Greek and Cyrillic entry improvements are a change in the default alpha keymap when the Greek or Cyrillic character menu is selected, where related letters are selected. Multiple presses on an alpha key will cycle through possible options. For example, in lowercase mode with the Greek character menu selected, typing E gives you ε, a second press gives you έ and a third press gives you e. Then it cycles. The mechanism is easy to configure and extensible, so that you can build your own character keymaps (math, French, etc) Special thanks to Demosthenes for drawing my attention to the problem.

The quick edit commands using transient alpha mode also derive from discussions with Jean Wilson. It gives you the first two levels of menu commands in the EDIT menu by holding UP/DOWN (LEFT/RIGHT) and F1-F6. For example, ▶F3 is a quick way to get the "next word" command, ▶F1 gives you Select (start a text selection), ▶F5 gives you Cut, ▶F6 gives you Paste, and ▶F4 gives you Search.

I have not forgotten the VAR VAR = CST suggestion by grbrum, but did not have time to implement it for this release.

DB48X,HP,me
Find all posts by this user
Quote this message in a reply
10-17-2024, 05:57 PM
Post: #335
RE: DB48X: HP48-like RPL implementation for DM42
Where do you get the skin for the DB48X for the DM42? Thanks
Find all posts by this user
Quote this message in a reply
10-17-2024, 06:43 PM (This post was last modified: 10-17-2024 06:44 PM by c3d.)
Post: #336
RE: DB48X: HP48-like RPL implementation for DM42
(10-17-2024 05:57 PM)cylurian Wrote:  Where do you get the skin for the DB48X for the DM42? Thanks

See this thread It's referenced from the documentation, but surprisingly not from the README or built-in help. Sorry, I will fix that.

Please be aware that, based on various feedback plus personal experience, I am likely to do one last major keyboard layout change (the primary changes being to put y^x and MTH as primary keys, but also to group things more logically even if it means deviating more from the HP42/DM42). Before I do that, I will put features in that let you customize the keyboard layout, and ship two configuration files for old and new overlays.

   

DB48X,HP,me
Find all posts by this user
Quote this message in a reply
10-21-2024, 05:49 AM (This post was last modified: 10-21-2024 05:52 AM by c3d.)
Post: #337
v0.8.2: Assignments, Custom menu
Release v0.8.2 is out.

This release is focusing on the testing, validation and usability of the equation library contributed by Jean Wilson. To that effect, it introduces a new kind of objects, assignments, that only exist on the DB48x and have no direct equivalent on original HP calculators. It also completes the support for library equations in the Root command.

Here is an example that illustrates these capabilities, testing the Ohm’s Law & Power equation in the library:

Code:

V=240_V  I=32_A
@ Expecting [ R=7.5 Ω P=7 680. W ]
'ROOT(ⒺOhm’s Law & Power;[R;P];[1_Ω;1_W])'

If you are reading this release note directly on the calculator, you can simply click ENTER while the text above shows up, and it will be copied in your editor. You can change the values of the input variables to explore various possibilities.

In this example, V=24_V is an assignment object that assigns the value 24_V to the global variable named V. It is almost equivalent to 24_V 'V' STO V, except that the value placed on the stack is the assignment object itself. In other words, evaluating V=24_V places V=24_V on the stack. This makes it easy to edit or evaluate assignments on the stack using the interactive stack. In particular, you can select an assignment on the stack wiht the interactive stack and use the Eval (F3) function to restore the variable to the value in the assignment.

The ROOT command in the example illustrates how you can directly use equations in the equation library as argument to Root, and use the multiple-equation solver to solve for more than one variable at a time.

All the examples in the on-line help are now also tested automatically, in order to ensure that all the given examples give the expected results.

Features
---------

* Implement CustomMenu, whicih is toggled by successive presses on the _VAR_ key. An example is shown in the Demo.48s file. The
content of the CST or CustomMenu variable is used to define this menu.
* The documentation now contains numerous executable examples. These examples are identified by a Markdown code block with the rpl syntax colorization indicator. They can be executed directly from the on-line help on the calculator by hitting ENTER while the code block is shown on the screen.
* The test suite automatically tests all the documentation examples.
* New equation sets: Light Propagation and Ultrarelativistic Cases
* Four new equations in Energy & Momentum equation set
* Assignment objects in the form Name=Value, e.g. A=3.
* The solver now emits assignment objects for the solution
* command to store while keeping value on stack. As an extension relative to the HP50G, this command also works inside RPL algebraic
expressions. For example 3▶A stores 3 in A and returns the value in A. The command is called Copy (the HP50G ARM calls it
_▶ (Store)_)
* The Root command now accepts library equations as input.
* Arrays and lists are now accepted in algebraic expressions, using ; as a separator between values. For example, '[1;2;3]+[4;5;6]'
adds two vectors using an algebraic notation. Vectors can contain algebraic expressions. For example '[x+1;y+2;z=3]' is a valid
vector expression.
* The solver now accepts algebraic input, including for the multiple equation solver using vectors as input.
* Ad RombergPlot example to Library and Demo file. This example shows how the Integrate command evaluates the underlying function.
* menus: Add XRng and YRng to the PlotMenu

Bug fixes
---------

* Fix a sign bug in the Simple Slope equation
* Fix "Too many open files" error while saving constants
* Avoid infinite loop for unterminated case statement
* What follows a unit in an algebraic expression is no longer ignored.'330_m-20_m' was incorrectly interpreted as '330_m', now
correctly computes '310_m'.
* Fix and document the Integrate imprecision and iteration settings.
* text: Respect display settings in →Str. For example, 3 FIX 0.1 →Str now returns "0.100" and not "0.1", like on HP calculators
* Repair parsing of HP-style complex numbers, e.g. (12;3)
* Refactoring of object insertion in text editor to fix various bugs, including the Echo command in the interactive stack inserting the
object at the end of the text editor instead of at the cursor position.
* Do not issue Invalid digit for base on the console parsing 1E-10
* Fix null-dereference issue in to_decimal_if_big, which could be triggered if interrupting an Integrate command using the _EXIT_ key.
* Avoid occasional garbage at right of menu area
* simulator: Ensure Copy correctly quotes equations
* Move image for _E Field Finite Line_ to right section

Improvements
------------

* Add references to keyboard overlays in the documentation
* Add documentation for the Root command
* Improve the way we generate the image files in the Makefile
* Improve solver behaviour when a solution is not found. Notably, the solver is more likely to converge towards an extremum, and is more likely to find complex roots.

DB48X,HP,me
Find all posts by this user
Quote this message in a reply
10-21-2024, 05:54 AM
Post: #338
RE: DB48X: HP48-like RPL implementation for DM42
(10-08-2024 03:18 AM)grbrum Wrote:  This is why I suggest a hybrid of CST/ASN solution.
Say you press VAR once, then you get to the normal VAR menu, with all VAR contents (in the future I guess you will implement directories)...
Say you press VAR VAR, then this can show only the items (programs or variables that the user decides to assign to those 18 blocks (or you can set F6 to change page).

Release v0.8.2 now implements a Custom menu that shows up when pressing VAR twice.

DB48X,HP,me
Find all posts by this user
Quote this message in a reply
10-21-2024, 10:04 AM
Post: #339
RE: DB48X: HP48-like RPL implementation for DM42
(10-21-2024 05:54 AM)c3d Wrote:  
(10-08-2024 03:18 AM)grbrum Wrote:  This is why I suggest a hybrid of CST/ASN solution.
Say you press VAR once, then you get to the normal VAR menu, with all VAR contents (in the future I guess you will implement directories)...
Say you press VAR VAR, then this can show only the items (programs or variables that the user decides to assign to those 18 blocks (or you can set F6 to change page).

Release v0.8.2 now implements a Custom menu that shows up when pressing VAR twice.

With crdir I created a directory 'test', that is shown and can be entered in VAR (pressing F1). There is message on 'ToggleCustomMenu', but I don't see any effect.

I cannot find any way to enable to show the path as part of some kind of status line. Is such a feature (like on HPs) planned?
Find all posts by this user
Quote this message in a reply
10-21-2024, 10:19 AM (This post was last modified: 10-21-2024 10:20 AM by c3d.)
Post: #340
RE: DB48X: HP48-like RPL implementation for DM42
(10-21-2024 10:04 AM)raprism Wrote:  
(10-21-2024 05:54 AM)c3d Wrote:  Release v0.8.2 now implements a Custom menu that shows up when pressing VAR twice.

With crdir I created a directory 'test', that is shown and can be entered in VAR (pressing F1). There is message on 'ToggleCustomMenu', but I don't see any effect.

You are in the 'test' directory, which is presumably empty. So the VAR key does not show anything (this can be controlled with the ShowEmptyMenu / HideEmptyMenu setting). If you do something like the code below, a menu will appear letting you evaluate, recall or store to A:

Code:

3 'A' STO

If you create a variable called `CST` (which expands to `CustomMenu`), then it will be used as the custom menu content. For example try this:

Code:

{ PATH HOME CRDIR RCL 'A' 42.42 } 'CST' STO

Quote:I cannot find any way to enable to show the path as part of some kind of status line. Is such a feature (like on HPs) planned?

Yes. At the moment, the header area is controlled by flags in a way similar to the DM42, but my plan is to have it controlled by a special variable called `Header` working in a way similar to the CustomMenu variable. In the meantime, the PATH command works and returns the path as a list.

DB48X,HP,me
Find all posts by this user
Quote this message in a reply
Post Reply 




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