<g> I've never done that, but I have done something like it:
str=word('true false',(0-fx)+2)
...where fx is Boolean. I hope I've done it only in programs I wrote for my
own use. But I sometimes write a tool for myself, then move it to a public
library on request, so that monster may be out there somewhere.
(If I have to explain it, it just proves I should never write it that way in
the first place. This is better:
if fx then str='true'; else str=true
But it sometimes pleases me to be too clever for my own good.)
---
Bob Bridges, [email protected], cell 336 382-7313
/* In its state of nature [a dog] has a smell, and habits, which frustrate
man's love; he washes it, house-trains it, teaches it not to steal, and is so
enabled to love it completely. To the puppy, the whole proceeding would seem,
if it were a theologian, to cast grave doubts on the "goodness" of man; but the
full-grown and full-trained dog, larger, healthier and longer-lived than the
wild dog, and admitted, as it were by Grace, to a whole world of affections,
loyalties, interests and comforts entirely beyond its animal destiny, would
have no such doubt. -C S Lewis, _The Problem of Pain_ */
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf
Of Paul Gilmartin
Sent: Friday, September 4, 2020 13:01
In Rexx I have sometimes, perhaps mischievously, replaced:
IF (var_a = var_b) THEN
THEN temp_var = some_string
ELSE tenp_var = ''
say string_a || temp_var || string_b
with:
say string_a || copies( some_string, (var_a = var_b) )string_b
to save a few lines of code.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN