newRPL - build 1255 released! [updated to 1299]
|
12-20-2019, 10:36 PM
Post: #628
|
|||
|
|||
RE: newRPL - build 1255 released! [updated to 1299]
(12-20-2019 09:42 PM)The Shadow Wrote:(12-19-2019 11:43 PM)Claudio L. Wrote: * New command MMAP, similar to MAP but for matrices/vectors. It takes a program or a symbolic and applies it to all elements. It defines variables i,j for the program to know the position of wach item, as well as Aij for the symbolic to know the existing element. Yes, one of the reasons I decided to split the matrix functionality from MAP is because lists are more complicated, they can be nested within each other, and may contain absolutely any object. With a vector/matrix object, having a pair of (i,j) is actually useful, and using a symbolic in place of a program is an idea I (cough) stole (cough) from MAKEMAT() on the Prime. Since MMAP works on an existing matrix, you'd have to create one with CON then apply MMAP to get the equivalent of MAKEMAT(). I don't see why I couldn't add a local variable tracking an index for the regular MAP (other than slowing down the entire process, it doesn't cause any problems), much like the NSUB/ENDSUB commands do for DOSUBS. The variable 'Ai' wouldn't make sense, since MAP does not accept a symbolic, only a program, and the program receives the element in the stack. Same thing with MMAP, Aij does not exist when you use a program, only for symbolics. (12-20-2019 09:42 PM)The Shadow Wrote: I like the changes, but I'm still dubious of having variables be 'possibly infinite' by default. My gut says it makes more sense for them to be finite by default, but no doubt there may be something I'm missing, as so often in the past. The way I saw it originally is that simplifying for example A*0 with 0 is completely wrong unless you have certain knowledge about the variable A (in this case, you know A cannot be infinite). So the system should act on the safe side and leave it alone unless the user explicitly provides that knowledge. On the other hand, when actually using it, it quickly gets annoying that all these trivial things don't get simplified: A/A, 0*A, A^0, etc. so I'd say a flag controlling the default assumptions is completely warranted (and I hate flags): Flags for default assumptions: * Force REAL: All variables assumed real (when no hint is given) regardless of Complex mode enabled or not. The default is variables assumed complex in complex mode, real otherwise. * Force COMPLEX: All variables assumed complex (when no hint is given) regardless of Complex mode. * Force FINITE: All variables assumed finite |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 10 Guest(s)