newRPL - build 1255 released! [updated to 1299]
|
01-06-2018, 08:27 PM
Post: #98
|
|||
|
|||
RE: newRPL - build 1001 released! [update:build 1016]
(01-06-2018 05:41 AM)The Shadow Wrote: I'm not quite clear on what FUNCEVAL does, could you explain a bit more? It's internal (but it needed a name!). You can't write the command FUNCEVAL as a command. Basically, whenever you write a symbolic: 'F(x,y,z)' the internal representation uses the hidden operator FUNCEVAL, therefore it's internally represented like this: 'FUNCEVAL(x,y,z,F)' where the name of the function to evaluate is the last argument. You'll never see this, it's completely transparent to the user. FUNCEVAL essentially puts all its arguments on the stack, then calls the operator FUNCEVAL which takes the function name from the stack. So when you define an object, your object needs to react to the FUNCEVAL operator if you want your object to be called as a function in symbolics. IDENT objects react by RCLaiming the contents of the variable to the stack, and passing FUNCEVAL to the contents. LIST and MATRIX objects react by using the arguments as an index and doing GET. Other objects don't implement the FUNCEVAL operator. Now an example: 'A(1)' will be compiled as FUNCEVAL(1,'A') which will be evaluated as << 1 'A' FUNCEVAL >> (again, all this is in theory, completely invisible to the user). Now the FUNCEVAL operator applied to the 'A' will RCL, and let's say for this example A contains the list { 10 11 12 }. Now we have on the stack 1 { 10 11 12 } and the FUNCEVAL operator is passed on the list. The list will simply do GET and return the 1st element in the list, which is 10. All the user can see is: 'A(1)' EVAL --> 10 (01-06-2018 05:41 AM)The Shadow Wrote: And what exactly are BINDATA objects for? In the past, HEX strings were used to store binary data of all kinds, and there were commands to extract nibbles out of that string. HEX strings don't exist in newRPL, but their functionality as a storage container is necessary for custom applications that for example try to read a file format that newRPL can't natively. If you load your data inside a BINDATA container, you can read (and write) bytes arbitrarily. I'll soon add a command SDREADBIN (in the same spirit of SDREADTEXT) to read arbitrary data that are not RPL objects (and same for writing). That opens up a whole new field of data newRPL will be able to work with, and all programmable from RPL. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 25 Guest(s)