Menu

#319 "rexxref 1.13.6. Environment Symbols" and "rexxpg 5.4.4" contain contradictory information

5.1.0
closed
Erich
None
1
2025-05-02
2024-04-03
No

Rexxpg is quite outdated in this respect. Maybe a copypaste would suffice.

Discussion

  • Josep Maria Blasco

    Additionally, rexxref 6.1. The Environment Directory (.ENVIRONMENT) says

    The Environment object directory contains all of the Rexx built-in classes (Array, etc.), the special Rexx constants .NIL, .TRUE, .FALSE, .ENDOFLINE, and the .RexxInfo object.

    This is false because of two reasons: (1) .environment~true, for example, is not a constant (you can assign another value, like 0, to it), and (2) .environment~true and .true are different objects. Since 1.13.6 states that .true, .false and .nil are looked first (which is perfectly understandable, for performance and possible optimization reasons), they should be removed from the description of .environment (although maybe not the values, for compatibility).

     
  • Josep Maria Blasco

    This first patch updates the note at the end of rexxref 1.13.16 by copying the one that can be found at rexxpg 5.4.4, which, surprisingly, is more modern and up-to.date.

     
  • Josep Maria Blasco

    This last patch updates rexxpg, so that it has information similar to the one on rexxref.

     
  • Erich

    Erich - 2024-08-18
    • status: open --> pending
    • assigned_to: Erich
     
  • Erich

    Erich - 2024-08-18

    rexxref correctly states that .environment contains entries NIL, TRUE and FALSE.
    Although obviously not recommended, a user can change these entries without interfering with normal Rexx operation as the named three constants are special-cased when looking up environment symbols.

    added some rexxref and rexxpg updates with [r12870]

     

    Related

    Commit: [r12870]

    • Josep Maria Blasco

      Thank you for the updates. I understand that .environment has entries for NIL, TRUE and FALSE. But rexxref 6.1 says that it contains "the special Rexx constants .NIL, .TRUE, [and] .FALSE". This is untrue, because of two reasons: 1) these values (i.e., .environment~x where x in "NIL", "TRUE", "FALSE") are not constant, because they can be changed; and 2) changing them does not alter (as you yourself point out) the behaviour of .NIL, .TRUE and .FALSE, as written in a normal user program.

      A normal user will not believe that these entries in .environment are "the special Rexx constants", if aware of this behaviour. My impression is that this is very misleading.

      Reality is the following: ".environment contains fake versions of .NIL, .TRUE and .FALSE. These are, indeed, not constants, but variables; you can change them if you want, even if we don't recommend doing it; but, still, .NIL, .TRUE and .FALSE will continue to work, unrelated to the values you may put in .environment. You can always access these more or less nonsensical values using expressions like .environment~true or .environment["TRUE"], etc.".

      I think users deserve to be told the truth: .environment holds (non-constant) copies of .NIL, .TRUE and .FALSE, for compatibility reasons and purposes: when ooRexx was in its infancy, it was deemed a good idea to store .NIL, .TRUE and .FALSE there, etc. Nowadays, .NIL, .TRUE and .FALSE are handled by some magic mechanisms of ooRexx, much more efficient, btw., and, for the first time in their life, these "constants" are real constants (i.e., there is no user mechanism capable of altering their values, irrespective of whether this change crashes running programs or not).

      Obviously, I am not proposing to explain all that; I would choose a simplified version. But I don't think that pretending that .NIL, .TRUE and .FALSE reside in .environment is a good idea. If nothing more, because it's plain false.

       
      • Josep Maria Blasco

        Indeed. See this REXXTRY run on Arca OS 5:

        parse version v
          .......................
        say v
        OBJREXX 6.00 18 May 1999
          .......................
        say .true
        1
          .......................
        .environment~true = 0
          .......................
        say .true
        0
          .......................
        if .true = 0 Then Say "Hi"
        Hi
        
         
  • Rony G. Flatscher

    • Status: pending --> closed
     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.