On 10/24/2022 3:59 PM, P.O. Jonsson wrote:
> I do not get the same results as you, not on Windows and not on macOS, I
> get The NIL object rather than „5“. Are you still referring to ooRexx 5.0.0?

>   rexxtry.rex:  Enter 'exit' to end.       Or '?' for online REXX help.
> .local~1e = 12;say .local~1e-3 .local~1e -3
> The NIL object 9
>   ........................................... rexxtry.rex on WindowsNT
> 
> .local~1e -3 comes out as 12-3 = 9 as expected, what do you think
> .local~1e-3 mean?  It looks as the item 3 steps before 1e to me (which
> is not defined) Maybe someone can explain what is going on here?

local~1e-3 is the same as local['1E-3'], the item with index '1E-3'.
I had set it in the previous step:

>> Am 24.10.2022 um 20:33 schrieb Glenn Knickerbocker <n...@bestweb.net
>>  ........................................... rexxtry.rex on WindowsNT
>> .local['1E-3']=5;say .1e-3 .local~1e-3
>> .1E-3 5
>>  ........................................... rexxtry.rex on WindowsNT
>>
>> The last one there was still slightly surprising, with -3 taken as part
>> of the method name, though it doesn't introduce any inconsistency with
>> Classic Rexx.  Definitely something to watch out for anytime you put
>> numbers in a directory:
>>
>> .local~1e = 12;say .local~1e-3 .local~1e -3
>> 5 9
>>  ........................................... rexxtry.rex on WindowsNT

Note that you can also set .local['1E -3'] but it doesn't cause quite
the same confusion, because to use blanks in a method name you have to
put it in quotes:

.local['1E-3'] = 5; .local['1E'] = 12; .local['1E -3'] = 17;
 say .local~1e-3 .local~1e -3 .local~'1e -3'
5 9 17
  ........................................... rexxtry.rex on WindowsNT

The key is that symbols are parsed out before forming the method call,
and symbols can include the + and - signs when they make valid numbers.
1e-3 is a symbol because it's a number, so it's used as the method name.
 The same wouldn't apply to 1e-x or 1x-3:

.local~1e = 12; x = 5; .local~1x = 25; say .local~1e-x .local~1x-3
7 22
  ........................................... rexxtry.rex on WindowsNT

¬R




_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to