In a current discussion on the new RexxLA list about using the stem class it has turned out to be quite difficult to understand the relationships with classic Rexx stems, namely the stem's name (can be optionally supplied as an argument to new) and the default value (can be set with []= and queried with [] which classic Rexx programmers won't be able to relate to).
If instead two attributes would be defined and documented, this would be clear for them and easy to apply, hence requesting the following two attributes:
stemName: allows to get current stem name and change it
defaultValue: getter and setter with the same semantics as [] and []=
Anonymous
+1 (Thanks, Rony)
On 2021-09-03 05:30, Rony G. Flatscher wrote:
Related
Feature Requests: #795
defaultValue already exists via the [] operator.
a. = 1
say a.[] -- displays "1"
Yes, it exists.
The RFE aims at making it easy for classic Rexx programmers to deal with stem objects (and maybe also students who are about to learn programming with ooRexx).
The [] and []= as well as being able to use a.[1] instead of a.1 look very "alienating" to them (it takes a while to get accustomed to).
If however they see an attribute "stemName" and "defaultValue" it will be an easier to understand idiom for them. It would be meant that the attributes would be added, but not to replace the existing behavior of [] and []=.
(And also maybe for the ooRexx acquanted: I had to research quite a bit to find out in the documentation about [] and []=, but I was almost certain, that it was impossible that you would have overlooked the need to get and set default values! o I kept looking until I found them. :) )