Ad notation: just an idea as "food for thoughts" for an alternate, "symbol
free" notation: what
about if making the variable reference feature available via the VAR()-BIF?
This idea would allow a
second argument "R" (for "reference") in the VAR()-BIF, which will return the
VariableReference of
the supplied variable.
Hence instead of writing:
a = 123
call foo &a
say a -- displays "124"
::routine foo
use arg &someVariable
someVariable += 1
return
one would code:
a = 123
call foo var(a,"reference")
say a -- displays "124"
::routine foo
use arg refVar
someVariable=var(refVar,"r")
someVariable += 1
return
As it may be expected that the variable reference is not needed as often in
Rexx/ooRexx as in a
C-based language, one may forgo a proper symbol operator for this quite
interesting functionality.
---rony
On 13.04.2018 11:30, Rony G. Flatscher wrote:
> There are at least two aspects for me: one is the functionality, one is the
> notation.
>
> * The functionality aspect is a generalization of "expose objvar" in
> method routines, now made
> available in general. Therefore it could be used e.g. in ooRexx routine
> packages where closely
> related routines can be coupled efficiently via the variable references
> or multiple variables
> can be updated directly hence foregoing the need to process return values
> to assign them to
> the variables in question and the like ...
>
> * Ad notation: there is a big difference between Rexx and Object Rexx from
> day one. Object Rexx
> introduced the tilde (~) and colons (in message names to indicate in
> which superclass to start
> resolution of the method) and double-colons (to clearly indicate the
> boundaries of directives
> that get preprocessed by the interpreter). And yes, initially they looked
> a little bit alien
> vis-a-vis to classic Rexx, but what is also observable, after a while (to
> get accustomed to
> them) they have been making quite a lot of sense in Object Rexx, and
> indeed make the new
> Object Rexx concepts clearly, explicitly visible.
> Since 20 years there has been no other "alien" character been introduced
> into the Object Rexx
> language, where "alien" relates to classic Rexx. I recall "&[&]" use in
> EXEC and in the C
> language.
> Using any symbol for the purpose of getting a reference to a variable
> seems to be o.k. as the
> operator needs to be explained anyway. My students for instance have
> usually no preset concept
> to "&", so that symbol is as fine as any other for them. Those who know
> C/C++ have probably no
> problem whatsoever to conceive the meaning immediately (learning that in
> ooRexx it would not
> be a memory address but a reference that gets returned). Whether EXEC
> programmers minds have
> been carved in stone such that they cannot conceive the meaning, well, I
> do not know how they
> would perceive that. But then, there is no need for them to use that
> feature (or any of the
> many other cool features of ooRexx), if they only have a need for the
> classic Rexx features.
>
> The examples that Rick showed can be taught easily and using the operator in
> both places
> (assignment expressions and USE ARG expressions) looks intuitive i.e. easily
> explainable.
>
> I would like to experiment, "play around", explore with it ASAP (hopefully
> being able to do so by
> early next week), also testing teaching it to the uninitiated to be able to
> assess that aspect as
> well.
>
> ---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