On Tue, 24 Nov 2020, at 03:19, Jackson, Rob wrote: > Years ago while disabling some built-in automation in SA for z/OS I > found that the REXX code SA actually ran live was almost all > "squished." I didn't dig into it, but I assumed (I still believe > safely) that it was to reduce interpreter overhead. I just took a look > at it tonight to see how the efficiency-minded SA developers coded > keywords. A brief look says the majority are first-letter capitalized > (as Mike said to do, I believe--which is the reason I always have)
Did he? My copy of The Rexx Language (pub 1990) has almost all its code samples (where there's several lines as if being a snippet of a program) written almost entirely in lowercase. That's also true of the complete sample program in one of the appendices. There's mixed case in comments, and literals that will be displayed to the user. In the complete program, labels have their first letter capitalised. The section of the book that covers built-in functions capitalises the whole of the function name in its single line examples of each one, and the option characters in functions like date(), but I think that's more to emphasise the function that's being discussed. I don't think I've ever done first-letter-only capitalisation of bits of a program - too fussy. > or completely capitalized; however, there are enough exceptions > to make me wonder. > By the way, if you haven't seen it, here's a snippet as an example. It > is really . . . something: > > If cond = 'NOVALUE' | cond = 'HALT' Then rc = 'N/A';Select > > When cond = 'HALT' Then desc = 'CLIST HALTED' > > When cond = 'SYNTAX' Then desc = errortext(rc);When cond = 'FAILURE' Then Do > > If rc = -1 Then;desc = 'COMMAND NOT FOUND';If rc = -3 Then > ... It's interesting; I've seen squished/crunched code in other languages where a lot more of the spaces would have been removed, and variable names shortened to one or two characters (often spread equally across the a-z namespace range, though whether that helps depends on how the runtime system implements variable look-up). If one chose to implement code looking like this one would need (I guess) to keep a more normally indented, one statement per line copy of the programs as editing a squished one would be very error-prone. I wonder if sourceline() works on physical (multi-statement) lines or logical statements? And sigl? It'd be deeply confusing if the sigl-derived line number in an error message was really a statement number rather than the physical line number in the squished code. Imagine if a single line had several similar statements on it... you wouldn't know which one had caused a particular error... -- Jeremy Nicoll - my opinions are my own. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
