Easy as { 1 2 3 }? (when { 1 2 3 } ≠ { 1 2 3 })
|
07-16-2018, 04:25 AM
(This post was last modified: 07-16-2018 04:25 AM by Claudio L..)
Post: #11
|
|||
|
|||
RE: Easy as { 1 2 3 }?
(07-15-2018 06:07 PM)DavidM Wrote:(07-15-2018 05:54 PM)Claudio L. Wrote: 4) Switch to newRPL, forget about this mess and relax.... I'm not joking, you are fighting to fix a system that is almost impossible to fix (I did succesfully modify the ROM back in the day to allow direct execution of C code, it was really hard so I know what you are facing). I feel your time and skills would be better spent on a system that CAN be fixed to your specs (that's the beauty of open source), hence I wanted to remind you you have a 4th option: come help with newRPL instead! I like what you did with the List processing library, many of those commands should've been in the ROM to begin with, and probably should be in newRPL too. You seem to have good ideas to either detect and fix "glitches" in the old system, or improve/expand the system, which is "by definition" the sole purpose of newRPL. BTW, newRPL does your { 1 2 3 } problem this way (for the interested): In my head, SAME refers to whether two things are identical or not, while == is more of a mathematical operator, between objects that have some definition of equality. Both are overloadable operators, so each object type defines how to behave (including cross-type operations). For most objects, SAME and == are equivalent, but for lists SAME always refers to the whole object, while == does list processing like most other operators, returning a list with the result of applying the operator to the elements. SAME applies the operator SAME recursively on each object of the list (better than a binary comparison, though object handlers are free to implement SAME as a binary data comparison), it returns a single true/false if all elements in the list are the SAME. { 1 2 3 } DUP 2 * 2 / SAME ---> 1 { 1 2 3 } { (1,0) 2 3 } SAME ---> 1 (because 1 (1,0) SAME is true in newRPL) == works element by element, recursively if needed be. It returns a list (or list of lists) with true/false elements. { 1 2 3 } DUP 2 * 2 / == ---> { 1 1 1 } Other composites behave different. For example a program defines SAME in a similar way to lists, but there's no equality between programs, the == operator is not defined so it throws an error. It may be debatable, but at least this behavior is very consistent throughout newRPL. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)