by karmakaze · 4y ago · 0 comments
Strings can be concatenated using either double pipes || or just no operator at all, E.G.
'String'FOO
will concatenate the 'String' literal and the FOO variable. Writing 'String' FOO
instead will put a literal space between the concatenated values. Hence, the || is useful for concatenating two variables: FOO = BAR||BAZ
The dot is used for denoting compound variables which, together with the INTERPRET statement, is what was really novel about Rexx IMHO: https://datagubbe.se/rexxtut/The compound variables are really useful, they allow me to create hash like structures in the Mainframe.
I assume you mean Rexx adds an extra space if whitespace is added between the values when concatenating them. I addressed this behavior (though perhaps a bit unclearly) in my original comment.
Very interesting, awk(1) also does this style of string concatenation; does anyone know of other languages with a similar design?
(I'm aware that many functional languages treat whitespace as function application.)