On 09.07.2018 23:24, Rick McGuire wrote: > Jon, > > A variable reference is something that works the way people keep thinking use > arg works. There are > basically three pieces to this: > > 1. A variable reference class that can hold a reference to a variable. Using > a variable reference > instance, a variable value can be retrieved or set. > 2. A new operator (well, two actually) that creates an instance of a variable > reference object > from the current execution context. > 3. An extension to USE ARG that allows an argument to be specified as a > required variable > reference. This type of argument creates a variable alias in the caller. > > Most of this is invisible to the caller, but, for example, suppose you want > to have a call where > you have an error code that is returned and you also wish to pass other > information back if the > call was successful. There are many awkward solutions that people have used > for this, but with the > variable references you can do this. > > if myFunc(>info) == 0 then > > The > prefix operator creates a reference to the variable info that is passed > to the caller. On > the call target side, you would have > > use arg >returnInfo > > ... > returnInfo = result > return 0 > > Assigning something to returnInfo actually assigns the value to the variable > info back in the > caller. Because the thing that gets passed around is an object instance, > this call-by-reference > type will also work from native code. > > This is not in trunk yet, only in the sandbox branch sandbox\rick\reference > > You would need to build this yourself or I believe Rony had a build in his > dropbox someplace. Yes, they still are there (I have a subdirectory with Rick's two sandbox versions, one "address with" and one "reference", here is the URL: <https://www.dropbox.com/sh/olh1mqfwb4brp7r/AABI1X-Le9zDCJ0gyfvMdKB8a?dl=0>.
Please note that there are a few little Rexx programs that experiment, "play" with the feature. Also, please note the dates of the productions (64-bit Windows versions only), i.e. the version that includes the variable reference feature was built on May 7th. Will try to find a time slot to update the reference sandbox version as I saw that new commits have been applied to it in the past days. ---rony ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel