Procedural and Object-oriented Programming 6

ooRexx Runtime Environment and Resolving Environment Symbols

080_ooRexx_environment_symbols_V15.md (2026-10-18 · 18:40:18)
v1.00 · 2026-10-02 (created 2026-11-12 23:15:16, md2slides v387)

Environment Symbols

  • Definition of an environment symbol
    • Starts with a dot

    • Followed by a Rexx symbol

    • Some examples for environment symbols with their resolved values:

      say .true    -- yields: 1 (environment constant)
      say .false   -- yields: 0 (environment constant)
      say .nil     -- yields: The NIL object (environment constant)
      say .he.ho   -- yields: .HE.HO (not found, environment symbol in uppercase)
      say .bag     -- yields: The Bag class (from REXX package, also .environment)
      say .output  -- yields: The OUTPUT monitor (from .local)
      .context~package~local~my.test="This is a test" -- add an entry to package's local
      say .my.test -- yields: This is a test
  • How does ooRexx arrive at these values?
080_ooRexx_environment_symbols_V15.md (2026-10-18 · 18:40:18)
v1.00 · 2026-10-02 (created 2026-11-12 23:15:16, md2slides v387)

Resolving Environment Symbols, 1

  1. First resolving the constants
    • .true (1), .false (0) or .nil (The NIL object)
  2. Next removing the leading dot, remaining symbol used for lookup
    1. Resolving classes
      1. Classes defined in the current program/package
      2. Public Classes of required programs
      3. ooRexx classes (REXX package) which also get stored in the .environment directory
    2. Resolving entries by looking up the following environment directories one by one
      1. The local package directory of the current program (i.e.: .context~package~local)
      2. The ooRexx .local environment directory (each ooRexx interpreter has a different one)
      3. The ooRexx global .environment directory (all ooRexx interpreters share this one)
      4. The ooRexx (unnamed) system directory
080_ooRexx_environment_symbols_V15.md (2026-10-18 · 18:40:18)
v1.00 · 2026-10-02 (created 2026-11-12 23:15:16, md2slides v387)

Resolving Environment Symbols, 2

  1. Next resolving the ooRexx runtime environment symbols
    • .CONTEXT, .LINE, .METHODS, .RESOURCES, .ROUTINES, or .RS
  2. Finally, if not found returning the environment symbol in uppercase
  • Note: ooRexx reserves symbols without a dot for itself
    • Hence, if you store entries in the package local, .local or global .environment directories then make sure that the index value (name without leading dot) you use contains at least one dot!

      Example:

      .local~my.secret="None of your business! ;)" -- store in .local directory
      say ".my.secret:" .my.secret -- displays: .my.secret: None of your business! ;)
080_ooRexx_environment_symbols_V15.md (2026-10-18 · 18:40:18)
v1.00 · 2026-10-02 (created 2026-11-12 23:15:16, md2slides v387)

Contact

WU

Prof. Mag. Dr. Rony G. Flatscher

Welthandelsplatz 1

1020 Wien/Vienna

Austria/Europe


www: www.wu.ac.at

080_ooRexx_environment_symbols_V15.md (2026-10-18 · 18:40:18)
v1.00 · 2026-10-02 (created 2026-11-12 23:15:16, md2slides v387)