Post Reply 
New RPL: New Commands
01-20-2017, 11:47 PM
Post: #13
RE: New RPL: New Commands
(01-19-2017 07:06 AM)The Shadow Wrote:  I've been thinking of getting a spare 50g while they can still be had, and finding out about newRPL has pushed me over the edge. Smile Thanks for your hard work and that of your team, Claudio!

That said, I do have a bit of a wishlist and a few suggested tweaks.

I love that you fixed the bizarre behavior of (sum)LIST and (product)LIST on lists of size 1. How about also adding the mathematical conventions for such operations on empty lists? By convention, the empty sum is 0 and the empty product is 1. This will save a bit of error handling, notably when dealing with lists produced by FACTORS.

There was some discussion about this. The sum or the product are not necessarily 0 or 1. The main issue is that an empty list doesn't have a type of element, therefore how do you know the result is supposed to be a number?

{ "A" "B" "C" } \(\sum\)LIST --> "ABC"
{ } \(\sum\)LIST --> "" ???
or it could be a sum of vectors, or mxn matrices, etc. you get the point.

Given only an empty list there's no way for these commands to know what the result should be.
The easy solution is to always add the neutral element of the correct type. If you want 3x3 matrices:

{ ..list, possibly empty... } { [[1 0 0] [0 1 0] [0 0 1]] } + \(\prod\)LIST

(01-19-2017 07:06 AM)The Shadow Wrote:  Speaking of FACTORS... I know the CAS is a ways off, but you're going to have to do it differently than in RPL. On the 50g, the primes are integers and the exponents are reals, which gives you a handle for differentiating them using MAP and DOLIST. That won't be the case in newRPL. I suggest implementing it as a list of lists, so 24 would become { { 2 3 } { 3 1 } }. Or possibly a list of complex numbers, { (2,3) (3,1) }, or even 2x1 vectors. Then, rather than treating units like -1 or i as factors, they could simply be stuck in the list as numbers - the different type would be sufficient to tell them apart from the others. 0 could also be treated this way, to spare us the absurdity of treating it as a factor.

EDIT: I just realized that complex numbers would give the nice ability to do RE or IM on the list as a whole, rather than having to do << 1 GET >> MAP or the like.

EDIT2: Actually, you know what? The best thing would just be to return three items, the unit (or 0), one list of factors and one of their exponents.

It's a valid point. I'll mark these suggestions when the time comes to implement FACTORS.

(01-19-2017 07:06 AM)The Shadow Wrote:  I would also dearly love to see commands to find the Hermite and Smith normal forms of a matrix!

Aesthetically speaking, I'd like to see most commands given names short enough to be differentiated in the menus. (Also, shouldn't the help tell us the name of the function, so we can tell them apart?)
Yes, that's a change that's on the pipeline. There's now space to display the command name above the text of the help.
Regarding the matrix normals, I'll try to remember when it's time to complete all those missing commands in the matrix library.

(01-20-2017 07:42 PM)The Shadow Wrote:  Also on the wish list: A built-in list subtraction command. (In the sense of set subtraction, not element by element.) I can certainly code it myself in RPL, but the faster the better!

A command to eliminate duplicate elements in a list. (Actually, the reverse POS command you mentioned elsewhere would make this much easier to code.)

List union and intersection would be nice too, but aren't as essential.

Commands to use lists as sets are interesting, I'll also add them if there's room and time.
I'll add all your ideas to our bug tracker, so I don't forget.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
New RPL: New Commands - compsystems - 12-28-2016, 06:06 PM
RE: New RPL: New Commands - Vtile - 12-28-2016, 06:15 PM
RE: New RPL: New Commands - compsystems - 12-28-2016, 08:17 PM
RE: New RPL: New Commands - Claudio L. - 12-29-2016, 03:16 AM
RE: New RPL: New Commands - compsystems - 01-16-2017, 12:17 AM
RE: New RPL: New Commands - Claudio L. - 01-16-2017, 04:24 PM
RE: New RPL: New Commands - compsystems - 01-16-2017, 04:39 PM
RE: New RPL: New Commands - Claudio L. - 01-17-2017, 02:26 PM
RE: New RPL: New Commands - Vtile - 01-17-2017, 03:50 PM
RE: New RPL: New Commands - Claudio L. - 01-17-2017, 07:42 PM
RE: New RPL: New Commands - The Shadow - 01-19-2017, 07:06 AM
RE: New RPL: New Commands - The Shadow - 01-20-2017, 07:42 PM
RE: New RPL: New Commands - Claudio L. - 01-20-2017 11:47 PM
RE: New RPL: New Commands - The Shadow - 01-21-2017, 04:29 AM
RE: New RPL: New Commands - Claudio L. - 01-22-2017, 01:53 AM
RE: New RPL: New Commands - The Shadow - 01-22-2017, 04:10 AM
RE: New RPL: New Commands - The Shadow - 01-21-2017, 08:17 PM



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