Post Reply 
DB48X: HP48-like RPL implementation for DM42
07-17-2023, 11:41 PM
Post: #28
RE: DB48X: HP48-like RPL implementation for DM42
Thanks for your reply.

(07-17-2023 07:13 PM)c3d Wrote:  The new features being added don't normally get in the way of compatibility, except maybe in corner cases that will have to be treated like bugs. If you can elaborate on how you see new features breaking compatibility (even if you don't have a precise example yet), please file issues on the project's GitHub's page to track it.

More precisely, I was thinking of backward compatibility... if possible.

(07-17-2023 07:13 PM)c3d Wrote:  For example, consider the `Dup` function. In DB48X, this can also be spelled `Duplicate`. There are preferences that let you display (and see it in the editor) as either `dup`, `DUP`, `Dup` or `Duplicate`. On input, you can spell it either way, as well as all case variants, e.g. `DUPLiCATE`.

Interesting, but it makes a big difference with RPL. As you know, on an hp-28 or hp-50, DUP is a command, whereas dup, Dup, dUP (...) will be considered as different variables.
In my opinion << Duplicate >> isn't very useful because it's too long. But I do understand that this is just an example.
It reminds me of WinDev (French Software Engineering Workshop) whose programming language can use English or French keywords. I don't know much more...

(07-17-2023 07:13 PM)c3d Wrote:  << Lambdas are already a part of standard RPL. \lambdax(x+1) is written « → x 'x+1' » in RPL. You do not need to name that object.

Yes, that's right!
When I talked about anonymous functions, I was thinking of something simpler in terms of syntax (no chevrons). But it's true that algebraic writing is, in this case, a very good alternative that I rarely think of. Nevertheless, you need to have one variable (or more).
Something like this (Python)
Code:
lambda : print('Hello World')
is not possible... but perhaps not very useful either.
À oublier… Wink

(07-17-2023 07:13 PM)c3d Wrote:  What could integrate well into RPL is an extension of the current local syntax to split lists into components. Something like « → { x y } « x x * y y * + » » would turn { 1 2 } into 5. The same could make sense for arrays as well, e.g. « → [ x y z ] 'sqrt(sq(x)+sq(y)+sq(z))' » would compute the norm of a 3-vector.

Interesting, but it requires a function capable of accurately processing the number of elements contained in the list. Or ?? https://www.hpmuseum.org/forum/thread-12902.html
Otherwise, the difference with this
Code:
<< 
{7 8} 'L' STO
'L(1)'  
'L(2)' 
→ x y ' x * x + y * y ' 
EVAL
>>
won't be that big. But for an array... yes!
On the other hand, if you do it for an array (or vector), why not do it for a list… or even a string. Smile

(07-17-2023 07:13 PM)c3d Wrote:  Structs also exist, they are called "lists". However, RPL is a dynamically typed language, and I do not plan on adding statically typed data (it would really not help much in terms of speed or size given how things are implemented today).

I don't know much about the underside of RPL (sysRPL). It's quite possible that adding a static data structure is very difficult.
In LISP (very list-oriented... ), it's possible to do this:

Code:
(defstruct book 
   title 
   author 
   subject 
   book-id 
)
https://www.tutorialspoint.com/lisp/lisp_structures.htm

I'm still convinced that it would be interesting to be able to do something similar, provided it's feasible, of course.

Another thing I'd thought of was the possibility of managing a (sequential) file… but there's no SD card reader in DM42 nor in DM32! Smile
Last but not least, I'm sure there are possibilities in https://www.hpcalc.org/details/7971 that could inspire you, if they haven't already.

Regards

Bruno
Sanyo CZ-0124 ⋅ TI-57 ⋅ HP-15C ⋅ Canon X-07 + XP-140 Monitor Card ⋅ HP-41CX ⋅ HP-28S ⋅ HP-50G ⋅ HP-50G
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: DB48X: HP48-like RPL implementation for DM42 - FLISZT - 07-17-2023 11:41 PM
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



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