Post Reply 
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:

DIRECTORY
'Var1' OBJECT
'Var2' OBJECT
...
ENDDIR

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.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: newRPL - build 1001 released! - pier4r - 12-16-2017, 08:03 AM
newRPL - on Hp 39gs - Martin Hepperle - 06-05-2019, 06:51 AM
RE: newRPL - build 1001 released! - pier4r - 12-23-2017, 10:16 AM
RE: newRPL - build 1001 released! - pier4r - 01-01-2018, 09:42 AM
t - Claudio L. - 01-01-2018, 03:06 PM
RE: newRPL - build 1001 released! - pier4r - 01-01-2018, 03:41 PM
RE: newRPL - build 1001 released! - pier4r - 01-02-2018, 04:54 PM
RE: newRPL - build 1001 released! - pier4r - 01-02-2018, 06:58 PM
newRPL - brickviking - 10-05-2018, 06:01 AM
RE: newRPL - build 1255 released! [updated to 1280] - Claudio L. - 07-28-2019 02:05 AM
How to participate? - erazor - 12-13-2019, 07:12 AM



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