Thank you, Rony;  This is a classic example of "...what a thing is, and what
a thing's name is...".  Charles Lutwidge Dodgson explained it all 150 years
ago.  

Walter, between Dodgson and Godel (pardon the spelling;  my keyboard does
not have an umlaut) language designers and implementers face an up-hill
battle to produce work that makes apparent sense.  Give them a break.  

It took me years and much frustration to understand this point;  Assembler
programmers should readily understand a thing's "name" (the name of the
field containing  an address) and the thing itself (the data structure
pointed to by the address).  This concept is one of the most fecund in
computer science.  Use it, don't lose it.

-----Original Message-----
From: Rony G. Flatscher [mailto:[email protected]] 
Sent: Monday, May 25, 2015 10:18
To: [email protected]
Subject: Re: [Oorexx-devel] stem assignment

Hi Walter,

first the example on Rosetta code you cite as a "real life" example comes
from your special friend, who tries to write Rexx as if it was Assembler at
times. So you should ask yourself how a "real life" example that would be.

(I have never seen a classic Rexx program that would use that kind of an
assignment. In this case I think it was used intentionally by the author to
not allow his program to run under ooRexx out of the box; it is not the
first such program he wrote as you know. Just ask yourself: how would you
have programmed that particular section yourself, the way your friend did it
or differently?)

Secondly, in ooRexx a stem is a reference to a stem object. If you assign a
stem (object) reference to a stem variable, then that stem variable refers
to the same stem object afterwards. A concept of a reference is not
available in classic Rexx that is the reason why stems cannot be passed
directly as arguments to Rexx internal routines. Rather you need to break
the local (procedure) scope with the expose statement in order to become
able to reference the stem in the calling part of the Rexx code. So in
classic Rexx you are also not able to pass stems as arguments to external
routines because of this restriction.

ooRexx introduced the "USE ARG" keyword statement to allow keeping the local
scope but becoming able to fetch any object, including a stem object via
reference and thereafter refer to it.

This behavior has been discussed here quite a few times over the years over
again (also on news:comp.lang.rexx).

The ooRexx documentation explicitly documents this, cf. "Example 1.24 Stems"
in ooRexx 4.2.0 rexxref.pdf.

---rony



On 25.05.2015 17:10, Walter Pachl wrote:
> I wa surprised to 'find' it in real life!
> And a little sentence right at the description of 'assignment' about 
> this special treatment could help.
> Such as mentioning the special treatment of the case when source and 
> targed are stems, And the feature of a.=fun() fun:... with return res. was
news to me.
> --
> Walter Pachl
>
> ---- Mike Cowlishaw <[email protected]> schrieb:
>>  
>> Walter, wasn't this one of the points you already made in your 
>> presentation about differences between different Rexxes?
>>
>> Not a lot of point in banging on it again -- it isn't going to change.
>>
>> Mike
>>
>>
>> ------
>>> That's the inside view.
>>> When I read about assingment, it says that the value of the 
>>> expression on the righthand side is assigned to the variable on the 
>>> lefthand side.
>>>
>>> consider
>>> r.=0
>>> r.3=16
>>> rr.=r.
>>> blabla=r.
>>> Say 'blabla='blabla
>>>      
>>> Walter Pachl
>>>
>>> ---- Rick McGuire <[email protected]> schrieb:
>>>> It most certainly IS an assignment.  The stem variable rr. 
>>> is set to
>>>> contain a reference to the same stem object referenced by the stem 
>>>> variable r.  ooRexx does not have a concept of variable
>>> aliasing. This
>>>> is the same assignment mechanism that allows USE ARG to work or 
>>>> returning a stem object from a function or method call.  I
>>> don't have
>>>> the reference handy right now so I can't cite chapter and
>>> verse, but this is most certainly documented.
>>>> Rick
>>>>
>>>> On Mon, May 25, 2015 at 7:10 AM, Walter Pachl 
>>>> <[email protected]>
>>>> wrote:
>>>>
>>>>> In REXX version 1 of this RC-task:
>>>>>
>>>>>
>>> http://rosettacode.org/wiki/Hofstadter_Figure-Figure_sequences#REXX
>>>>> there is this statement
>>>>>
>>>>> rr.=r.;
>>>>>
>>>>> which shows a severe incompatibility.
>>>>>
>>>>>
>>>>>
>>>>> With Regina, this program runs fine.
>>>>>
>>>>> With ooRexx it fails!
>>>>>
>>>>>
>>>>>
>>>>> The reason is that the above is NOT an assignment
>>>>>
>>>>> but it makes rr. a synonym/alias for r.
>>>>>
>>>>>
>>>>>
>>>>> I skimmed the ooRexx reference and could not find a
>>>>>
>>>>> description of this fact.
>>>>>
>>>>>
>>>>>
>>>>> Besides: This IS a bit of a surprise and what I
>>>>>
>>>>> don't quite understand what this is good for.
>>>>>
>>>>>
>>>>>
>>>>> Regards,
>>>>>
>>>>> Walter
>>

----------------------------------------------------------------------------
--
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications Performance
metrics, stats and reports that give you Actionable Insights Deep dive
visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel



------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to