On 20.04.2024 17:40, Paul Gilmartin wrote:
On Sat, 20 Apr 2024 11:08:03 -0400, Bob Bridges wrote:
It was while I was coding in REXX that I tried abutting a variable named 'x' 
with another string, and couldn't figure out why the program behaved as it did. 
 Eventually figured out I had inadvertently created a hex constant.  Maybe as 
an overreaction, I have never since used one-character variable names, always 
two or more.  (What do I use for loop counters?, you ask.  I use 'j' plus 
another letter; 'jr' for records, for example, 'jd' for days whatever.  More 
obvious would have been 'i', but there are too many two-letter reserved words 
even in REXX that start with 'i'.)

There are *no* reserved words in Rexx like in many other languages. (This alleviates one to have to learn them by heart. But more importantly, should the language get additional keywords over time they would not break existing Rexx programs that happen to use them already, unlike other programming languages.)

I like to use longer names with mnemonic value as control variables and,
if the body of the loop is more than a couple lines, cite the control
variable at the END so the interpreter verifies nesting.

Rexx is chaotic in context sensitivity of reserved words and in symbols'
being evaluated almost everywhere with exceptions for e.g. ADDRESS.

There are no reserved keywords therefore it is interesting that you see something chaotic there. But maybe some of the fundamental Rexx rules are not really known or possibly forgotten over time.

The Rexx rules are quite simple:

 * everything outside of quotes gets uppercased,

     o the content of quoted strings can be anything and never gets changed 
(truly immutable),

 * blanks around operators get removed,

 * a blank between literals and symbols is the blank concatenation operator

 * a symbol that was not assigned a value evaluates to the symbol itself (its 
name which is the
   uppercased string), otherwise it evaluates to its currently assigned value

The next step is to determine what kind of an instruction the resulting string represents in order to carry it out:

 * if the second token is an equal sign then it is an assignment instruction 
that gets carried out:
   the expression right of the equal sign (RHS) gets evaluated and assigned to 
the symbol (e.g.
   ABC=3+4) to the left of the equal sign (LHS),

 * if it is not an assignment instruction and the first symbol is a keyword 
then it is a keyword
   instruction that gets carried out,

 * if it is neither then the resulting string is a command instruction which 
gets handed over to
   the operating system for execution, the command's return code can be 
inspected immediately upon
   return by using the Rexx variable RC (set by Rexx to make the return code of 
the command
   immediately available to the Rexx program).

The ADDRESS keyword instruction is just one of the keyword instructions of Rexx which will allow to control to which Rexx command handler the command instruction gets sent to (among other things the ADDRESS instruction allows to switch among different Rexx command handlers).

Variable precision arithmetic is a boon.  But there is no convenient
library of elementary functions, probably the reason for the lack of
elementary functions in Rexx.

This depends what functionalities you are missing/seeking. There are quite a few Rexx function libraries, many implemented in Assembler or C++.

If using ooRexx there is a free, open-source ooRexx-Java bridge available which will make immediately *all* Java class libraries there are and all their functionality available to ooRexx, really, all of them! The external function and class libraries in this case are not implemented in C++ or Assembler, but in Java. And Java has become *fast*, one of the fastest languages there is.

If you look at Java and its standard runtime environment (JRE) you hardly miss any functionality there, from GUIs, to XML processing to secure Internet programming etc. E.g. if you have a need to transport data via SSL/TLS you get that infrastructure from the JRE for free at your fingertips (on all platforms) and can exploit it from Java, and with the ooRexx-Java bridge installed also directly from ooRexx.

Anyway, it is hard to conceive functionality that could not be made available to Rexx/ooRexx one way or the other.

---rony

--
--
__________________________________________________________________________________

Prof. Dr. Rony G. Flatscher
Department Wirtschaftsinformatik und Operations Management
Institut für Wirtschaftsinformatik und Gesellschaft
D2c 2.086
WU Wien
Welthandelsplatz 1
A-1020  Wien/Vienna, Austria/Europe

http://www.wu.ac.at
__________________________________________________________________________________




----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to