Post Reply 
newRPL - build 1255 released! [updated to 1299]
07-30-2019, 02:10 PM (This post was last modified: 07-30-2019 02:19 PM by Claudio L..)
Post: #535
RE: newRPL - build 1255 released! [updated to 1282]
(07-29-2019 10:49 PM)JoJo1973 Wrote:  
(07-28-2019 02:05 AM)Claudio L. Wrote:  Basically you provide a name of a directory or a path (double list, same format used for STO) and do PACKDIR.

Wait, wait, is there a specific syntax for paths? Can you provide an example? What do you mean by double list? Which commands support them, apart from those mentioned above?

Yes, there's a special syntax for paths. The reason being that I wanted RCL and STO to be able to do list processing just like every other command, for consistency.
The problem is, because RCL and STO "normally" would interpret a list as a path instead of as a list of names, list processing was not possible.
So I tweaked the syntax a little bit:
Paths must be expressed as list of lists: { { HOME 'MyDIR' } }, so if STO receives a list of lists, it will consider it a path and will store a single object in level 2 into the single variable given by the path. Otherwise it will consider it a list of names and will take a list in level 2 with the same number of elements, performing a multiple STO into the current directory.
There's a couple of limitations to this syntax:
* The first name of the list of names can't be a path, others can be paths (always use a list of list for paths, even within the list of names)
* If you provide a single object and a list of names, the same object will be stored in all the names (useful to zero-out many variables at once when you start your program). However, that object cannot be a list otherwise each element will be stored in a separate variable. This means you can't store the same list to multiple variables.

I know it departs from the standard, but it's useful to have list processing on STO and RCL.

EDIT: Since we are already touching the topic, there's another enhancement in paths: UPDIR can be used anywhere within a path just like you would use "..":
Code:

"./mydir/myvar" ---> { { 'mydir' 'myvar' } }
"../otherdir/othervar" ---> { { UPDIR 'otherdir' 'othervar' } }
"/maindir/../mydir/myvar" ---> { { HOME 'maindir' UPDIR 'mydir' 'myvar } }
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 1282] - Claudio L. - 07-30-2019 02:10 PM
How to participate? - erazor - 12-13-2019, 07:12 AM



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