On 23.04.2024 05:03, Andrew Rowley wrote:
On 23/04/2024 11:55 am, Paul Gilmartin wrote:
On Tue, 23 Apr 2024 10:59:47 +1000, Andrew Rowley  wrote:
    ...
To me, it is much clearer to be explicit, including the concatenation, e.g.
"DELETE " || foo
That overkill is apt to confuse a POSIX shell partisan who would
see the blank as part of the command name

Isn't Rexx assembling it all into one string, which gets then run as the 
command?

There can be significant spaces between parts of the command, and no spaces allowed in other parts. So you could have e.g.

"DELETE ABC" || suffix
or
"DELETE" prefix || suffix
which is very different from
"DELETE" prefix suffix

and it can get much more complex. I would rather use a consistent concatenation operator and explicitly insert spaces rather than rely on getting the right concatenation operator in the right place.

It's a matter of style, but there are some things that just look like potential bugs to me.

The nice thing is that Rexx allows different variants of string concatenations and one is free to use what seems to be the "easiest", the "safest". Personally I use blank concatenations by default and abuttal or || only if there really should not be a single blank between the concatenated strings which is very rarely the case. Again, YMMV.

---

At <https://wi.wu.ac.at/rgf/rexx/misc/jdor_doc.tmp/jdor_doc.html> you will find a Rexx program at the top that uses Java2D to create and save a bitmap which is shown underneath (among many other things it demos how to define a specific font and get the dimensions of a string in that font in order become able to center the string on that bitmap and how to color that string freely).

If you look at the Rexx code (98% is classic Rexx) it may be surprising how the commands and the Rexx language integrate together well (the syntax coloring of the code stems from IntelliJ and the aforementioned ooRexx plugin).

As you can probably see the way Rexx allows one to use a command language like JDOR is really impressive (just look how one can intermix Rexx expressions with JDOR commands)!

The point here is: none of these JDOR commands are variables, they are commands (e.g. drawLine), more specifically here they are plain Rexx symbols. They get uppercased by Rexx and then handed over to the command handler to process it. In this case adding NOVALUE would force you to enquote all the commands which is cumbersome and also looks quite strange thereafter.

---rony

----------------------------------------------------------------------
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