---
rexxpub:
  defaults: rony.yaml
  logo: oorexx
---

<!-- 080_ooRexx_environment_symbols_V15.odp (2026-10-15 09:37) -->

<!-- slide # 1 (2026-10-15 09:37) ----------------------------- ODP slide # 1 -->
. slide cover
# Procedural and Object-oriented Programming 6

. subtitle
**ooRexx Runtime Environment and Resolving Environment Symbols**

. cover-art
. picture img/080_ooRexx_environment_symbols_V15/p01-diagram-7.png

<!-- slide # 2 (2026-10-15 09:37) ----------------------------- ODP slide # 2 -->
. slide reference="Cf. rexxref.pdf (1.13.6. Environment Symbols)"
# Environment Symbols

. steps
- Definition of an environment symbol
    . after
    - Starts with a dot
    . after
    - Followed by a Rexx symbol
    - Some examples for environment symbols with their resolved values:

      . after
      ```rexx
      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?

<!-- slide # 3 (2026-10-15 09:37) ----------------------------- ODP slide # 3 -->
. slide reference="Cf. rexxref.pdf (1.13.6. Environment Symbols)"
# Resolving Environment Symbols

. after
1. First resolving the constants
    . after
    - `.true`{.rexx} (`1`), `.false`{.rexx} (`0`) or `.nil`{.rexx} (*The NIL object*)
. click
2. Next removing the leading dot, remaining symbol used for lookup
    . after
    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
    . click
    2) Resolving entries by looking up the following environment directories one by one
        . after
        1) The `local` package directory of the current program (i.e.: `.context~package~local`{.rexx})
        . with
        2) The ooRexx `.local`{.rexx} environment directory (each ooRexx interpreter has a different one)
        . with
        3) The ooRexx global `.environment`{.rexx} directory (all ooRexx interpreters share this one)
        . with
        4) The ooRexx (unnamed) system directory

<!-- slide # 4 (2026-10-15 09:37) ----------------------------- ODP slide # 4 -->
. slide reference="Cf. rexxref.pdf (1.13.6. Environment Symbols)"
# Resolving Environment Symbols

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

      . click label
      Example:

      . after
      ```rexx
      .local~my.secret="None of your business! ;)" -- store in .local directory
      say ".my.secret:" .my.secret -- displays: .my.secret: None of your business! ;)
      ```

<!-- slide # 5 (2026-10-15 09:37) ------------ business card (not in the ODP) -->
. slide card logo=none
# Contact