     REXX V2.0      INTERNAL & BUGS                               o o
                                                                ____oo_
     Author: Vasilis N. Vlachoudis                  1992-2002  /||    |\
     Addr:   Div. SL-EET, CERN                         BNV      ||    |
             Geneva-23, CH-1211                      MARMITA    `.___.'
             Switzerland                                    
     Tel:    +33-4.50.99.18.32
     E-Mail: Vasilis.Vlachoudis@cern.ch
     http:   http://home.cern.ch/bnv


     About this document
     ~~~~~~~~~~~~~~~~~~~
        The following document describes some techical details and bugs
     concerning this version of rexx, and it is normally out of common
     interest.


     General
     ~~~~~~~
        Variables are hold in a binary tree, where the tree is
     balanced when one branch starts to become very big. Even though
     the variables are stored as a bintree there is a cache system
     for the faster access.
     
        Numeric digits exists as a command but has no effect.
     
        Each variable in rexx is a length prefix string, and it is kept
     in memory in 3 different types, long, real, string according the
     last operation that affect that variable.
         ie.     a = 2          /* will be kept as string  (Length-prefixed) */
                 a = 2 + 1      /* will be kept as integer (long) */
                 a = 2 + 0.1    /* will be kept as real    (double) */

        I use this scheme just to make a little bit faster the
     expression evaluation. This approach has some disadvantages because
     integer operations have a maximum of 2billion number so if you try
     something like this
              factorial = 1
              do i = 1 to 50
                 factorial = factorial * i
              end
     will result to 0 instead of the factorial of 50! To find the
     correct result you have to fool the interpreter to think that
     factorial is real and not integer, this can be done if you write
     factorial = 1.0 ....
     
        You can easilly translate a variable to any format you like with
     the following instructions
             a = a + 0.0   /* will translate a to real */
             a = trunc(a)  /* will translate a to integer */
             a = a || ''   /* will translate a to string */
     
         Subscripts of a stem (array) are not translated to uppercase
         and neither blanks are removed
              so:     sub = 'mama mia'
                  ara.sub = 3
              will be kept in memory as a variable 'ARA.mama mia'
     
        Sometimes it is very important to know how a variable is kept in
     memory (usually for the INTR function) so there is an extra option
     in DATATYPE function "TYPE" that returns the way one variable is
     hold.
              DATATYPE(2,"TYPE")     -> "STRING"
              DATATYPE(2+0.0,"TYPE") -> "REAL"
              DATATYPE(2+0,"TYPE)    -> "INT"
     
        C routines are used for the translation of string to number, so
     a string like '-  2' will be reported by DATATYPE as a NUMber when
     rexx tries to evaluate it as a number it will return a value of 0
     instead of -2, because of the spaces between the sign and the
     number.

        STEMS:  substitution to stems may be anything including strings
     with any character. No translation to uppercase is done to subscripts
     so:        lower = 'ma'  ; stem.lower   -->  'STEM.ma'
                upper = 'MA'  ; setm.upper   -- > 'STEM.MA'
     Stems can be initialized with a command like
                stem. = 'Initial value'
     

     Functions
     ~~~~~~~~~
        Even though the depth nesting limitation is 250, stack in the
     16bit-DOS version it will crash with nesting near 90.
     
        If a program or a dos command is used as an external rexx
     function the interpreter will call COMMAND interpreter to execute
     the command with its output redirected to a dummy file. The dummy
     file will be created in the current directory or in a temporary
     directory that is pointed by TEMP environment variable.
     
        TRANSLATE sometimes wont work properly for strings with
     characters above ASCII 127. Works OK for Greek character set.

        VARTREE wont work properly with variables with non-printable
     characters
