newRPL - build 1255 released! [updated to 1299]
|
07-28-2019, 02:05 AM
Post: #532
|
|||
|
|||
RE: newRPL - build 1255 released! [updated to 1280]
(07-27-2019 03:07 PM)The Shadow Wrote: Looks great, Claudio! Could you tell us more about the new PACKDIR objects and editable directory trees? Basically you provide a name of a directory or a path (double list, same format used for STO) and do PACKDIR. You'll see for yourself, but basically the syntax is: Code:
Of course, OBJECT can also be a subdirectory (same DIRECTORY ... ENDDIR syntax) This packed directory can be transferred as a single object on the USB or stored in an SD card for quick backup, could also be used to distribute software of you don't want to create a library, etc. You can simply move somewhere else in your path, and store this under a new name to get the entire directory tree restored. You cannot store it to a temporary variable since directories are not supported there. I could expand all vars it into a local environment, but no subdirectories would be allowed, so it's not really a tree, and it's not really faster than using a global directory. For now I decided to only allow packed directories to be expanded into global variables. It's nothing new or exciting, just that it was nice to be able to edit entire directories as source code on a PC rather than individual variables, and newRPL lacked that feature because of the internal format of the directories. Regarding memory usage: PACKDIR needs to include a copy of all objects and their names so if you try to pack HOME for example you need to have more than 50% of free memory available. Unpacking on the other hand does not make another copy, the objects in the directory are still pointing to within the packed directory object. This is good because it requires very little extra memory, bad because even if you purge all variables but one, the entire packed directory object cannot be purged by the garbage collector. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)