Re: REXX true/false (was Constant Identifiers)

2020-09-10 Thread Seymour J Metz
Don't forget the short lived name MPPL.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3



From: IBM Mainframe Discussion List  on behalf of CM 
Poncelet 
Sent: Wednesday, September 9, 2020 10:06 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: REXX true/false (was Constant Identifiers)

Yes. My post-grad thesis was on PL/I - and on its being originally
called Fortran VI in 1962, then NPL in '64, then distributed as PL/I in
'66 together with OS/360.

I wrote PL/I before Clist/CLIST and long before REXX.

Confused am I?



On 09/09/2020 05:49, Seymour J Metz wrote:
> Have you ever heard of PL/I? Much of the syntax of REXX derives from PL/I, 
> and it has two different string types: CHARACTER and BIT.
>
> With regard to the built in functions, you are once again confusing the type 
> of a variable with its contents. Would you argue that +1 in -1 are different 
> data types because one is a valid input to sqrt and the other is not?
>
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
>
>
> 
> From: IBM Mainframe Discussion List  on behalf of 
> CM Poncelet 
> Sent: Tuesday, September 8, 2020 7:53 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: REXX true/false (was Constant Identifiers)
>
> Mr Bridges,
>
> 1) The reason the program does not abend is it has a "SIGNAL ON SYNTAX
> NAME ERROR3" coded before the "IF TRUE THEN...", which traps the abend
> and resumes execution at label ERROR3.
>
> 2) I disagree with Mr Metz on the grounds that he argues that
> "everything in REXX is a character string" - upon which I then
> implicitly ask, "What is a non-character string and in what 3GL, 2GL,
> 1GL language (but not 0GL, as that would be microcode) do such
> non-character strings exist that do not exist in REXX?"
>
> It has nothing to do with EBCDIC and ASCII. It is that REXX supports all
> binary strings - as in the REXX functions C2D, C2X, D2X, X2B, B2X,
> BITAND, BITOR, BITXOR etc. and as applied in reading/processing
> unformatted 'raw' system dumps. To argue that "everything in REXX is a
> character string"is meaningless. It might be appropriate to argue that
> "everything in REXX is a binary string", as that would include
> "character string" - or even "everything in REXX is a string", because
> that would be sufficient in itself and would not constrain all REXX
> strings to have to be "character" ones. As I said, REXX supports all
> binary strings - not only "character" ones.
>
> Not sure whether that answers your questions, but I hope it does.
>
> Cheers, Chris Poncelet (retired sysprog)
>
>
> On 08/09/2020 16:27, Bob Bridges wrote:
>> Mr Poncelet, I'm interested in this example.  Two questions:
>>
>> 1) Once TRUE is set to a '1'b in the last two sections, why does the program
>> not abend when it encounters "IF TRUE THEN..."?  Seems to me REXX should
>> complain that TRUE is not 1 or 0.
>>
>> 2) From your preceding posts I got the impression you were disagreeing with
>> Mr Metz, that you believed REXX represented data in other forms that EBCDIC
>> character strings.  (EBCDIC in TSO REXX, that is; I'm not concerned with
>> ASCII platforms here.)  But your example seems to support his assertion.
>> Did I misunderstand you?  What am I missing?
>>
>> ---
>> Bob Bridges, robhbrid...@gmail.com, cell 336 382-7313
>>
>> /* This is how sin happens. We don't set out to do something very wrong. We
>> make up stories that sound good to ourselves about how the thing really
>> isn't that wrong, or how it really isn't anybody else's business. / Before
>> we lie to others, we lie to ourselves. Do that, and it can be hard to find
>> the truth again, even when it is obvious nothing but the truth will do.
>> -Maggie Gallagher, 2001-08-27 */
>>
>> -Original Message-
>> From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
>> Behalf Of CM Poncelet
>> Sent: Monday, September 7, 2020 22:33
>>
>> You said, "It isn't boolean; everything in REXX is a character string."
>>
>> I agree that "it's all strings", but not that "everything in REXX is a
>> *character* string."
>>
>> Try the following:
>>
>> ARG DEBUG
>> IF ABBREV(DEBUG,D,1) THEN ,
>>   TRACE I
>>
>> SIGNAL ON SYNTAX NAME ERROR0
>> TRUE = 1
>> SAY 'TRUE NUMERIC   = 'TRUE
>> SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
>> IF ¬TRUE THEN SAY 'NOT TRUE NUMERIC'
>> IF TRUE THEN SAY 'YES, TRUE NUMERIC'
>>
>> 

Re: REXX true/false (was Constant Identifiers)

2020-09-10 Thread Seymour J Metz
ITYM follow on from EXEC2. Or was Mike working on REX before EXEC2?


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3



From: IBM Mainframe Discussion List  on behalf of 
Rupert Reynolds 
Sent: Thursday, September 10, 2020 8:05 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: REXX true/false (was Constant Identifiers)

Confused? Difficult to say--the brash nature of this debate is clouding
things.

There is an example above which uses something like ''0001'B to
initialise a variable.

In Rexx, that is not a boolean value. Depending on which interpreter you
use, it is either a byte with contents x'01', which might be printable in
some character sets, or it's a string of seven characters '0', a character
'1' and a character 'B'. The only numbers I've found thay work in boolean
expressions are 1 and 0.

There were always going to be compromises building an interpreted language
to follow on from the EXEC interpreter on VM/SP.

Rupert



On Thu., Sep. 10, 2020, 03:06 CM Poncelet,  wrote:

> Yes. My post-grad thesis was on PL/I - and on its being originally
> called Fortran VI in 1962, then NPL in '64, then distributed as PL/I in
> '66 together with OS/360.
>
> I wrote PL/I before Clist/CLIST and long before REXX.
>
> Confused am I?
>
>
>

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

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


Re: REXX true/false (was Constant Identifiers)

2020-09-10 Thread Bob Bridges
I dunno, though, the first part of it was entertaining.  And as I'm not a 
systems programmer (I came into mainframe security through the development 
door), many of the more on-topic threads here are opaque to me, so the 
occasional fight over COBOL or CLIST provides some diversion.

---
Bob Bridges, robhbrid...@gmail.com, cell 336 382-7313

/* Three people may keep a secret, if two of them are dead.  -Poor Richard */

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of David Crayford
Sent: Thursday, September 10, 2020 08:34

Perfect example of bike shedding! A rambling thread where people argue 
over stuff that is not really useful! IBMMAIN is difficult to read these 
days.

The good stuff is clouded by topic drift and endless arguments that go 
on forever.

--- On 2020-09-10 8:05 PM, Rupert Reynolds wrote:
> Confused? Difficult to say--the brash nature of this debate is clouding
> things.

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


Re: REXX true/false (was Constant Identifiers)

2020-09-10 Thread David Crayford

On 2020-09-10 8:05 PM, Rupert Reynolds wrote:

Confused? Difficult to say--the brash nature of this debate is clouding
things.


Perfect example of bike shedding! A rambling thread where people argue 
over stuff that is not really useful! IBMMAIN is difficult to read these 
days.
The good stuff is clouded by topic drift and endless arguments that go 
on forever.


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


Re: REXX true/false (was Constant Identifiers)

2020-09-10 Thread Rupert Reynolds
Confused? Difficult to say--the brash nature of this debate is clouding
things.

There is an example above which uses something like ''0001'B to
initialise a variable.

In Rexx, that is not a boolean value. Depending on which interpreter you
use, it is either a byte with contents x'01', which might be printable in
some character sets, or it's a string of seven characters '0', a character
'1' and a character 'B'. The only numbers I've found thay work in boolean
expressions are 1 and 0.

There were always going to be compromises building an interpreted language
to follow on from the EXEC interpreter on VM/SP.

Rupert



On Thu., Sep. 10, 2020, 03:06 CM Poncelet,  wrote:

> Yes. My post-grad thesis was on PL/I - and on its being originally
> called Fortran VI in 1962, then NPL in '64, then distributed as PL/I in
> '66 together with OS/360.
>
> I wrote PL/I before Clist/CLIST and long before REXX.
>
> Confused am I?
>
>
>

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


Re: REXX true/false (was Constant Identifiers)

2020-09-09 Thread CM Poncelet
Yes. My post-grad thesis was on PL/I - and on its being originally
called Fortran VI in 1962, then NPL in '64, then distributed as PL/I in
'66 together with OS/360.
 
I wrote PL/I before Clist/CLIST and long before REXX. 
 
Confused am I?
 
 

On 09/09/2020 05:49, Seymour J Metz wrote:
> Have you ever heard of PL/I? Much of the syntax of REXX derives from PL/I, 
> and it has two different string types: CHARACTER and BIT. 
>
> With regard to the built in functions, you are once again confusing the type 
> of a variable with its contents. Would you argue that +1 in -1 are different 
> data types because one is a valid input to sqrt and the other is not?
>
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
>
>
> 
> From: IBM Mainframe Discussion List  on behalf of 
> CM Poncelet 
> Sent: Tuesday, September 8, 2020 7:53 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: REXX true/false (was Constant Identifiers)
>
> Mr Bridges,
>
> 1) The reason the program does not abend is it has a "SIGNAL ON SYNTAX
> NAME ERROR3" coded before the "IF TRUE THEN...", which traps the abend
> and resumes execution at label ERROR3.
>
> 2) I disagree with Mr Metz on the grounds that he argues that
> "everything in REXX is a character string" - upon which I then
> implicitly ask, "What is a non-character string and in what 3GL, 2GL,
> 1GL language (but not 0GL, as that would be microcode) do such
> non-character strings exist that do not exist in REXX?"
>
> It has nothing to do with EBCDIC and ASCII. It is that REXX supports all
> binary strings - as in the REXX functions C2D, C2X, D2X, X2B, B2X,
> BITAND, BITOR, BITXOR etc. and as applied in reading/processing
> unformatted 'raw' system dumps. To argue that "everything in REXX is a
> character string"is meaningless. It might be appropriate to argue that
> "everything in REXX is a binary string", as that would include
> "character string" - or even "everything in REXX is a string", because
> that would be sufficient in itself and would not constrain all REXX
> strings to have to be "character" ones. As I said, REXX supports all
> binary strings - not only "character" ones.
>
> Not sure whether that answers your questions, but I hope it does.
>
> Cheers, Chris Poncelet (retired sysprog)
>
>
> On 08/09/2020 16:27, Bob Bridges wrote:
>> Mr Poncelet, I'm interested in this example.  Two questions:
>>
>> 1) Once TRUE is set to a '1'b in the last two sections, why does the program
>> not abend when it encounters "IF TRUE THEN..."?  Seems to me REXX should
>> complain that TRUE is not 1 or 0.
>>
>> 2) From your preceding posts I got the impression you were disagreeing with
>> Mr Metz, that you believed REXX represented data in other forms that EBCDIC
>> character strings.  (EBCDIC in TSO REXX, that is; I'm not concerned with
>> ASCII platforms here.)  But your example seems to support his assertion.
>> Did I misunderstand you?  What am I missing?
>>
>> ---
>> Bob Bridges, robhbrid...@gmail.com, cell 336 382-7313
>>
>> /* This is how sin happens. We don't set out to do something very wrong. We
>> make up stories that sound good to ourselves about how the thing really
>> isn't that wrong, or how it really isn't anybody else's business. / Before
>> we lie to others, we lie to ourselves. Do that, and it can be hard to find
>> the truth again, even when it is obvious nothing but the truth will do.
>> -Maggie Gallagher, 2001-08-27 */
>>
>> -Original Message-
>> From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
>> Behalf Of CM Poncelet
>> Sent: Monday, September 7, 2020 22:33
>>
>> You said, "It isn't boolean; everything in REXX is a character string."
>>
>> I agree that "it's all strings", but not that "everything in REXX is a
>> *character* string."
>>
>> Try the following:
>>
>> ARG DEBUG
>> IF ABBREV(DEBUG,D,1) THEN ,
>>   TRACE I
>>
>> SIGNAL ON SYNTAX NAME ERROR0
>> TRUE = 1
>> SAY 'TRUE NUMERIC   = 'TRUE
>> SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
>> IF ¬TRUE THEN SAY 'NOT TRUE NUMERIC'
>> IF TRUE THEN SAY 'YES, TRUE NUMERIC'
>>
>> ERROR0:
>> SIGNAL ON SYNTAX NAME ERROR1
>> TRUE = '1'
>> SAY 'TRUE CHARACTER = 'TRUE
>> SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
>> IF ¬TRUE THEN SAY 'NOT TRUE CHARACTER'
>> IF TRUE THEN SAY 'YES, TRUE CHARACTER'
>>
>> ERROR1:
>> SIGNAL ON SYNTAX NAME ERROR2
>> TRUE = '

Re: REXX true/false (was Constant Identifiers)

2020-09-09 Thread Paul Gilmartin
On Wed, 9 Sep 2020 00:45:12 -0400, Phil Smith III wrote:

>Y'all are dancing on the head of a pin. As Shmuel said, Rexx has one datatype, 
>period. It has the DATATYPE function that can do some
>analysis on a variable's contents and tell you whether it's all numeric, hex, 
>etc. That's basically it. Arguing about whether it's a
>"string" or a "character string" is just more dancing: since there's only the 
>one type, what does it matter?
> 
In creative writing, variety is the soul; in technical writing, it's
the devil.  Using "string" in some places and "character string"
in others without defining both is bad practice.

This fiber of the thread frayed off when someone with a PL/I
background said that in Rexx '1'b can be used as [a value for
TRUE].  No, it's syntactically invalid to do that.


On Wed, 9 Sep 2020 04:49:13 +, Seymour J Metz wrote:

>Have you ever heard of PL/I? Much of the syntax of REXX derives from PL/I, and 
>it has two different string types: CHARACTER and BIT. 
>
But it is not the responsibility of Rexx documentation to
distinguish itself and/or adopt jargon from that of all other
programming languages.

In TSO-Rexx James Campbell posted a good critique of my critique.

-- gil

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


Re: REXX true/false (was Constant Identifiers)

2020-09-08 Thread Seymour J Metz
Have you ever heard of PL/I? Much of the syntax of REXX derives from PL/I, and 
it has two different string types: CHARACTER and BIT. 

With regard to the built in functions, you are once again confusing the type of 
a variable with its contents. Would you argue that +1 in -1 are different data 
types because one is a valid input to sqrt and the other is not?


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3



From: IBM Mainframe Discussion List  on behalf of CM 
Poncelet 
Sent: Tuesday, September 8, 2020 7:53 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: REXX true/false (was Constant Identifiers)

Mr Bridges,

1) The reason the program does not abend is it has a "SIGNAL ON SYNTAX
NAME ERROR3" coded before the "IF TRUE THEN...", which traps the abend
and resumes execution at label ERROR3.

2) I disagree with Mr Metz on the grounds that he argues that
"everything in REXX is a character string" - upon which I then
implicitly ask, "What is a non-character string and in what 3GL, 2GL,
1GL language (but not 0GL, as that would be microcode) do such
non-character strings exist that do not exist in REXX?"

It has nothing to do with EBCDIC and ASCII. It is that REXX supports all
binary strings - as in the REXX functions C2D, C2X, D2X, X2B, B2X,
BITAND, BITOR, BITXOR etc. and as applied in reading/processing
unformatted 'raw' system dumps. To argue that "everything in REXX is a
character string"is meaningless. It might be appropriate to argue that
"everything in REXX is a binary string", as that would include
"character string" - or even "everything in REXX is a string", because
that would be sufficient in itself and would not constrain all REXX
strings to have to be "character" ones. As I said, REXX supports all
binary strings - not only "character" ones.

Not sure whether that answers your questions, but I hope it does.

Cheers, Chris Poncelet (retired sysprog)


On 08/09/2020 16:27, Bob Bridges wrote:
> Mr Poncelet, I'm interested in this example.  Two questions:
>
> 1) Once TRUE is set to a '1'b in the last two sections, why does the program
> not abend when it encounters "IF TRUE THEN..."?  Seems to me REXX should
> complain that TRUE is not 1 or 0.
>
> 2) From your preceding posts I got the impression you were disagreeing with
> Mr Metz, that you believed REXX represented data in other forms that EBCDIC
> character strings.  (EBCDIC in TSO REXX, that is; I'm not concerned with
> ASCII platforms here.)  But your example seems to support his assertion.
> Did I misunderstand you?  What am I missing?
>
> ---
> Bob Bridges, robhbrid...@gmail.com, cell 336 382-7313
>
> /* This is how sin happens. We don't set out to do something very wrong. We
> make up stories that sound good to ourselves about how the thing really
> isn't that wrong, or how it really isn't anybody else's business. / Before
> we lie to others, we lie to ourselves. Do that, and it can be hard to find
> the truth again, even when it is obvious nothing but the truth will do.
> -Maggie Gallagher, 2001-08-27 */
>
> -Original Message-
> From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
> Behalf Of CM Poncelet
> Sent: Monday, September 7, 2020 22:33
>
> You said, "It isn't boolean; everything in REXX is a character string."
>
> I agree that "it's all strings", but not that "everything in REXX is a
> *character* string."
>
> Try the following:
>
> ARG DEBUG
> IF ABBREV(DEBUG,D,1) THEN ,
>   TRACE I
>
> SIGNAL ON SYNTAX NAME ERROR0
> TRUE = 1
> SAY 'TRUE NUMERIC   = 'TRUE
> SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
> IF ¬TRUE THEN SAY 'NOT TRUE NUMERIC'
> IF TRUE THEN SAY 'YES, TRUE NUMERIC'
>
> ERROR0:
> SIGNAL ON SYNTAX NAME ERROR1
> TRUE = '1'
> SAY 'TRUE CHARACTER = 'TRUE
> SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
> IF ¬TRUE THEN SAY 'NOT TRUE CHARACTER'
> IF TRUE THEN SAY 'YES, TRUE CHARACTER'
>
> ERROR1:
> SIGNAL ON SYNTAX NAME ERROR2
> TRUE = '31'X
> SAY 'TRUE HEXADECIMAL = 'TRUE
> SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
> IF ¬TRUE THEN SAY 'NOT TRUE HEXADECIMAL'
> IF TRUE THEN SAY 'YES, TRUE HEXADECIMAL'
>
> TRUE = '00110001'B
> SAY 'TRUE BINARY HEX  = 'TRUE
> SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
> IF ¬TRUE THEN SAY 'NOT TRUE BINARY HEX'
> IF TRUE THEN SAY 'YES, TRUE BINARY HEX'
>
> TRUE = '0001'B
> SAY 'TRUE BINARY ONLY = 'TRUE
> SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
> IF ¬TRUE THEN SAY 'NOT TRUE BINARY ONLY'
> IF TRUE THEN SAY 'YES, TRUE BINARY ONLY'
>
> ERROR2:
> SIGNAL ON SYNTAX NAME ERROR3
> TRUE = '1'B
> SAY 'TRUE BINARY BIT  = 'TRUE
> SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
> IF ¬TRUE THEN SAY 

Re: REXX true/false (was Constant Identifiers)

2020-09-08 Thread Phil Smith III
Y'all are dancing on the head of a pin. As Shmuel said, Rexx has one datatype, 
period. It has the DATATYPE function that can do some
analysis on a variable's contents and tell you whether it's all numeric, hex, 
etc. That's basically it. Arguing about whether it's a
"string" or a "character string" is just more dancing: since there's only the 
one type, what does it matter?

 

Yes, the doc could probably be clearer, but the note saying:

Numbers:
These are *character* strings consisting of one or more decimal digits, 
...

is not incorrect, just needs that extra clarification. Their point is that it 
isn't BCD or binary or packed decimal: it's F0 through
F9 (in EBCDIC).

 

Seems odd that over 40 years into Rexx's existence, this is coming up as if 
it's something new?!

 

Also:

> REXX does not distinguish between quoted and unquoted data.

That's just wrong. Unquoted values are evaluated as variables; it's just that 
uninitialized variables default to uppercase versions
of their names. But it's fundamentally different, even if the result is (often) 
the same.

 

And now I'm sorry I waded into this mess, I think.

 

...phsiii


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


Re: REXX true/false (was Constant Identifiers)

2020-09-08 Thread CM Poncelet
Don't bother. IBM will reply NAPWAD (not a problem, working as
designed). ;-)

On 08/09/2020 16:22, Paul Gilmartin wrote:
> (cross-posting to IBM-Main and TSO-REXX)
> On 2020-09-08, at 00:23:52, CM Poncelet  wrote:
>> A *character* string is either any string that has DATATYPE CHAR but not
>> DATATYPE NUM, or is *any* string (and it might as well then be called
>> 'anything string' instead of 'character string').  
>>  
> You're motivating me to an RCF.  I invite emendations
> before I submit it:
>
> Hello, MHVRCFs,
>
> In: z/OS Version 2 Release 4
> TSO/E REXX Reference  IBM  SA32-0972-40
>
> I see numerous instances of "character string", and
> fewer of simply "string".  I believe this is a
> distinction without a difference.  If there is a
> difference between "character string" and "string"
> it should be explained in an introductory chapter.
> Otherwise, "character string" is a pleonasm and
> its every occurrence should be changed simply to
> "string".
>
> This has led one reader to misunderstand that
> "character string" means only a string for which
> the DATATYPE() function returns CHAR.
>
> There are several occurrences of "a single character
> string".  This is ambiguous.  I believe in each case
> it means "exactly one string", but it might be
> misunderstood as "a string containing exactly one
> character".  This ambiguity would be removed by
> rephrasing as simply "a single string".
>
> Under "Tokens" the document should clarify as:
> String constanta are denotations of string
> values.  A string constant may have one of
> four forms:
> Constant Symbols
> A constant symbol is a symbol starting with
> '.' or a number or to which no value has been
> assigned.
> Literal Strings
> [ ... ]
> The sentence,
> A literal string with no characters (that is, a
> string of length 0) is called a null string. 
> is misplaced and overspecified.  A null string may also
> be represented by a hexadecimal string (''X), a binary
> string (''B), or by an expression.  This is adequately
> described under "Expressions" and should be omitted
> from "Literal Strings".
> Hexadecimal Strings
> [  ]
> Binary Strings
> [  ]
>
> Under "Expressions":
> Expressions
> ...
> Terms include:
> • Literal Strings (delimited by quotation marks),
> which are constants
> An overspecification.  Hexadecimal strings and Binary strings
> are also allowed.  Simply "Strings" would suffice.  (There
> should be a period at the end of that sentence.)
>
> Thanks,
> gil
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> .
>

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


Re: REXX true/false (was Constant Identifiers)

2020-09-08 Thread CM Poncelet
Mr Bridges,
 
1) The reason the program does not abend is it has a "SIGNAL ON SYNTAX
NAME ERROR3" coded before the "IF TRUE THEN...", which traps the abend
and resumes execution at label ERROR3.
 
2) I disagree with Mr Metz on the grounds that he argues that
"everything in REXX is a character string" - upon which I then
implicitly ask, "What is a non-character string and in what 3GL, 2GL,
1GL language (but not 0GL, as that would be microcode) do such
non-character strings exist that do not exist in REXX?"
 
It has nothing to do with EBCDIC and ASCII. It is that REXX supports all
binary strings - as in the REXX functions C2D, C2X, D2X, X2B, B2X,
BITAND, BITOR, BITXOR etc. and as applied in reading/processing
unformatted 'raw' system dumps. To argue that "everything in REXX is a
character string"is meaningless. It might be appropriate to argue that
"everything in REXX is a binary string", as that would include
"character string" - or even "everything in REXX is a string", because
that would be sufficient in itself and would not constrain all REXX
strings to have to be "character" ones. As I said, REXX supports all
binary strings - not only "character" ones. 
 
Not sure whether that answers your questions, but I hope it does.
 
Cheers, Chris Poncelet (retired sysprog)
 

On 08/09/2020 16:27, Bob Bridges wrote:
> Mr Poncelet, I'm interested in this example.  Two questions:
>
> 1) Once TRUE is set to a '1'b in the last two sections, why does the program
> not abend when it encounters "IF TRUE THEN..."?  Seems to me REXX should
> complain that TRUE is not 1 or 0.
>
> 2) From your preceding posts I got the impression you were disagreeing with
> Mr Metz, that you believed REXX represented data in other forms that EBCDIC
> character strings.  (EBCDIC in TSO REXX, that is; I'm not concerned with
> ASCII platforms here.)  But your example seems to support his assertion.
> Did I misunderstand you?  What am I missing?
>
> ---
> Bob Bridges, robhbrid...@gmail.com, cell 336 382-7313
>
> /* This is how sin happens. We don't set out to do something very wrong. We
> make up stories that sound good to ourselves about how the thing really
> isn't that wrong, or how it really isn't anybody else's business. / Before
> we lie to others, we lie to ourselves. Do that, and it can be hard to find
> the truth again, even when it is obvious nothing but the truth will do.
> -Maggie Gallagher, 2001-08-27 */
>
> -Original Message-
> From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
> Behalf Of CM Poncelet
> Sent: Monday, September 7, 2020 22:33
>
> You said, "It isn't boolean; everything in REXX is a character string."
>  
> I agree that "it's all strings", but not that "everything in REXX is a
> *character* string."
>  
> Try the following:
>  
> ARG DEBUG
> IF ABBREV(DEBUG,D,1) THEN ,
>   TRACE I
>  
> SIGNAL ON SYNTAX NAME ERROR0
> TRUE = 1
> SAY 'TRUE NUMERIC   = 'TRUE
> SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
> IF ¬TRUE THEN SAY 'NOT TRUE NUMERIC'
> IF TRUE THEN SAY 'YES, TRUE NUMERIC'
>
> ERROR0:
> SIGNAL ON SYNTAX NAME ERROR1
> TRUE = '1'
> SAY 'TRUE CHARACTER = 'TRUE
> SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
> IF ¬TRUE THEN SAY 'NOT TRUE CHARACTER'
> IF TRUE THEN SAY 'YES, TRUE CHARACTER'
>
> ERROR1:
> SIGNAL ON SYNTAX NAME ERROR2
> TRUE = '31'X
> SAY 'TRUE HEXADECIMAL = 'TRUE
> SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
> IF ¬TRUE THEN SAY 'NOT TRUE HEXADECIMAL'
> IF TRUE THEN SAY 'YES, TRUE HEXADECIMAL'
>
> TRUE = '00110001'B
> SAY 'TRUE BINARY HEX  = 'TRUE
> SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
> IF ¬TRUE THEN SAY 'NOT TRUE BINARY HEX'
> IF TRUE THEN SAY 'YES, TRUE BINARY HEX'
>
> TRUE = '0001'B
> SAY 'TRUE BINARY ONLY = 'TRUE
> SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
> IF ¬TRUE THEN SAY 'NOT TRUE BINARY ONLY'
> IF TRUE THEN SAY 'YES, TRUE BINARY ONLY'
>
> ERROR2:
> SIGNAL ON SYNTAX NAME ERROR3
> TRUE = '1'B
> SAY 'TRUE BINARY BIT  = 'TRUE
> SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
> IF ¬TRUE THEN SAY 'NOT TRUE BINARY BIT'
> IF TRUE THEN SAY 'YES, TRUE BINARY BIT'
>
> ERROR3:
> EXIT 0
>  
>  
> ... which produces output:
>  
> TRUE NUMERIC   = 1
> DATATYPE TRUE  = NUM
> YES, TRUE NUMERIC
> TRUE CHARACTER = 1
> DATATYPE TRUE  = NUM
> YES, TRUE CHARACTER
> TRUE HEXADECIMAL = 1
> DATATYPE TRUE  = NUM
> YES, TRUE HEXADECIMAL
> TRUE BINARY HEX  = 1
> DATATYPE TRUE  = NUM
> YES, TRUE BINARY HEX
> TRUE BINARY ONLY = ?    <--
> DATATYPE TRUE  = CHAR   <--
> TRUE BINARY BIT  = ?    <--
> DATATYPE TRUE  = CHAR   <--
>
> PRESS ANY KEY TO CONTINUE.
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> .
>

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


Re: REXX true/false (was Constant Identifiers)

2020-09-08 Thread Seymour J Metz
Well, the distinction doesn't exist in REXX, but in PL/I there are bit strings 
and character strings, two different types. IMHO it would be clearer to 
consistently use the nomenclature character string. Possibly also a note that 
an implementation is free to use multiple internal representations, e.g, UTF-8 
versus EBCDIC, as long as the external results are the same.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3



From: IBM Mainframe Discussion List  on behalf of 
Paul Gilmartin <000433f07816-dmarc-requ...@listserv.ua.edu>
Sent: Tuesday, September 8, 2020 11:22 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: REXX true/false (was Constant Identifiers)

(cross-posting to IBM-Main and TSO-REXX)
On 2020-09-08, at 00:23:52, CM Poncelet  wrote:
>
> A *character* string is either any string that has DATATYPE CHAR but not
> DATATYPE NUM, or is *any* string (and it might as well then be called
> 'anything string' instead of 'character string').
>
You're motivating me to an RCF.  I invite emendations
before I submit it:

Hello, MHVRCFs,

In: z/OS Version 2 Release 4
TSO/E REXX Reference  IBM  SA32-0972-40

I see numerous instances of "character string", and
fewer of simply "string".  I believe this is a
distinction without a difference.  If there is a
difference between "character string" and "string"
it should be explained in an introductory chapter.
Otherwise, "character string" is a pleonasm and
its every occurrence should be changed simply to
"string".

This has led one reader to misunderstand that
"character string" means only a string for which
the DATATYPE() function returns CHAR.

There are several occurrences of "a single character
string".  This is ambiguous.  I believe in each case
it means "exactly one string", but it might be
misunderstood as "a string containing exactly one
character".  This ambiguity would be removed by
rephrasing as simply "a single string".

Under "Tokens" the document should clarify as:
String constanta are denotations of string
values.  A string constant may have one of
four forms:
Constant Symbols
A constant symbol is a symbol starting with
'.' or a number or to which no value has been
assigned.
Literal Strings
[ ... ]
The sentence,
A literal string with no characters (that is, a
string of length 0) is called a null string.
is misplaced and overspecified.  A null string may also
be represented by a hexadecimal string (''X), a binary
string (''B), or by an expression.  This is adequately
described under "Expressions" and should be omitted
from "Literal Strings".
Hexadecimal Strings
[  ]
Binary Strings
[  ]

Under "Expressions":
Expressions
...
Terms include:
• Literal Strings (delimited by quotation marks),
which are constants
An overspecification.  Hexadecimal strings and Binary strings
are also allowed.  Simply "Strings" would suffice.  (There
should be a period at the end of that sentence.)

Thanks,
gil

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

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


Re: REXX true/false (was Constant Identifiers)

2020-09-08 Thread Bob Bridges
Mr Poncelet, I'm interested in this example.  Two questions:

1) Once TRUE is set to a '1'b in the last two sections, why does the program
not abend when it encounters "IF TRUE THEN..."?  Seems to me REXX should
complain that TRUE is not 1 or 0.

2) From your preceding posts I got the impression you were disagreeing with
Mr Metz, that you believed REXX represented data in other forms that EBCDIC
character strings.  (EBCDIC in TSO REXX, that is; I'm not concerned with
ASCII platforms here.)  But your example seems to support his assertion.
Did I misunderstand you?  What am I missing?

---
Bob Bridges, robhbrid...@gmail.com, cell 336 382-7313

/* This is how sin happens. We don't set out to do something very wrong. We
make up stories that sound good to ourselves about how the thing really
isn't that wrong, or how it really isn't anybody else's business. / Before
we lie to others, we lie to ourselves. Do that, and it can be hard to find
the truth again, even when it is obvious nothing but the truth will do.
-Maggie Gallagher, 2001-08-27 */

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
Behalf Of CM Poncelet
Sent: Monday, September 7, 2020 22:33

You said, "It isn't boolean; everything in REXX is a character string."
 
I agree that "it's all strings", but not that "everything in REXX is a
*character* string."
 
Try the following:
 
ARG DEBUG
IF ABBREV(DEBUG,D,1) THEN ,
  TRACE I
 
SIGNAL ON SYNTAX NAME ERROR0
TRUE = 1
SAY 'TRUE NUMERIC   = 'TRUE
SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
IF ¬TRUE THEN SAY 'NOT TRUE NUMERIC'
IF TRUE THEN SAY 'YES, TRUE NUMERIC'

ERROR0:
SIGNAL ON SYNTAX NAME ERROR1
TRUE = '1'
SAY 'TRUE CHARACTER = 'TRUE
SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
IF ¬TRUE THEN SAY 'NOT TRUE CHARACTER'
IF TRUE THEN SAY 'YES, TRUE CHARACTER'

ERROR1:
SIGNAL ON SYNTAX NAME ERROR2
TRUE = '31'X
SAY 'TRUE HEXADECIMAL = 'TRUE
SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
IF ¬TRUE THEN SAY 'NOT TRUE HEXADECIMAL'
IF TRUE THEN SAY 'YES, TRUE HEXADECIMAL'

TRUE = '00110001'B
SAY 'TRUE BINARY HEX  = 'TRUE
SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
IF ¬TRUE THEN SAY 'NOT TRUE BINARY HEX'
IF TRUE THEN SAY 'YES, TRUE BINARY HEX'

TRUE = '0001'B
SAY 'TRUE BINARY ONLY = 'TRUE
SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
IF ¬TRUE THEN SAY 'NOT TRUE BINARY ONLY'
IF TRUE THEN SAY 'YES, TRUE BINARY ONLY'

ERROR2:
SIGNAL ON SYNTAX NAME ERROR3
TRUE = '1'B
SAY 'TRUE BINARY BIT  = 'TRUE
SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
IF ¬TRUE THEN SAY 'NOT TRUE BINARY BIT'
IF TRUE THEN SAY 'YES, TRUE BINARY BIT'

ERROR3:
EXIT 0
 
 
... which produces output:
 
TRUE NUMERIC   = 1
DATATYPE TRUE  = NUM
YES, TRUE NUMERIC
TRUE CHARACTER = 1
DATATYPE TRUE  = NUM
YES, TRUE CHARACTER
TRUE HEXADECIMAL = 1
DATATYPE TRUE  = NUM
YES, TRUE HEXADECIMAL
TRUE BINARY HEX  = 1
DATATYPE TRUE  = NUM
YES, TRUE BINARY HEX
TRUE BINARY ONLY = ?    <--
DATATYPE TRUE  = CHAR   <--
TRUE BINARY BIT  = ?    <--
DATATYPE TRUE  = CHAR   <--

PRESS ANY KEY TO CONTINUE.

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


Re: REXX true/false (was Constant Identifiers)

2020-09-08 Thread Paul Gilmartin
(cross-posting to IBM-Main and TSO-REXX)
On 2020-09-08, at 00:23:52, CM Poncelet  wrote:
> 
> A *character* string is either any string that has DATATYPE CHAR but not
> DATATYPE NUM, or is *any* string (and it might as well then be called
> 'anything string' instead of 'character string').  
>  
You're motivating me to an RCF.  I invite emendations
before I submit it:

Hello, MHVRCFs,

In: z/OS Version 2 Release 4
TSO/E REXX Reference  IBM  SA32-0972-40

I see numerous instances of "character string", and
fewer of simply "string".  I believe this is a
distinction without a difference.  If there is a
difference between "character string" and "string"
it should be explained in an introductory chapter.
Otherwise, "character string" is a pleonasm and
its every occurrence should be changed simply to
"string".

This has led one reader to misunderstand that
"character string" means only a string for which
the DATATYPE() function returns CHAR.

There are several occurrences of "a single character
string".  This is ambiguous.  I believe in each case
it means "exactly one string", but it might be
misunderstood as "a string containing exactly one
character".  This ambiguity would be removed by
rephrasing as simply "a single string".

Under "Tokens" the document should clarify as:
String constanta are denotations of string
values.  A string constant may have one of
four forms:
Constant Symbols
A constant symbol is a symbol starting with
'.' or a number or to which no value has been
assigned.
Literal Strings
[ ... ]
The sentence,
A literal string with no characters (that is, a
string of length 0) is called a null string. 
is misplaced and overspecified.  A null string may also
be represented by a hexadecimal string (''X), a binary
string (''B), or by an expression.  This is adequately
described under "Expressions" and should be omitted
from "Literal Strings".
Hexadecimal Strings
[  ]
Binary Strings
[  ]

Under "Expressions":
Expressions
...
Terms include:
• Literal Strings (delimited by quotation marks),
which are constants
An overspecification.  Hexadecimal strings and Binary strings
are also allowed.  Simply "Strings" would suffice.  (There
should be a period at the end of that sentence.)

Thanks,
gil

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


Re: REXX true/false (was Constant Identifiers)

2020-09-08 Thread Seymour J Metz
> I agree that "it's all strings", but not that 
> "everything in REXX is a *character* string."

That may be your opinion, but the opinion of Mike Cowlishaw is the one that 
matters.

The DATATYPE() built in function does not identify the type of a variable; it 
classifies the type of a value, at least in SAA REXX; in Object Rexx it's 
different. In your code replace TRUE with the appropriate constants in 
datatype(true) and the results won't change, because datatype test the vvalue, 
not how it was calculated.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3



From: IBM Mainframe Discussion List  on behalf of CM 
Poncelet 
Sent: Monday, September 7, 2020 10:33 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: REXX true/false (was Constant Identifiers)

You said, "It isn't boolean; everything in REXX is a character string."

I agree that "it's all strings", but not that "everything in REXX is a
*character* string."

Try the following:

ARG DEBUG
IF ABBREV(DEBUG,D,1) THEN ,
  TRACE I

SIGNAL ON SYNTAX NAME ERROR0
TRUE = 1
SAY 'TRUE NUMERIC   = 'TRUE
SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
IF ¬TRUE THEN SAY 'NOT TRUE NUMERIC'
IF TRUE THEN SAY 'YES, TRUE NUMERIC'

ERROR0:
SIGNAL ON SYNTAX NAME ERROR1
TRUE = '1'
SAY 'TRUE CHARACTER = 'TRUE
SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
IF ¬TRUE THEN SAY 'NOT TRUE CHARACTER'
IF TRUE THEN SAY 'YES, TRUE CHARACTER'

ERROR1:
SIGNAL ON SYNTAX NAME ERROR2
TRUE = '31'X
SAY 'TRUE HEXADECIMAL = 'TRUE
SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
IF ¬TRUE THEN SAY 'NOT TRUE HEXADECIMAL'
IF TRUE THEN SAY 'YES, TRUE HEXADECIMAL'

TRUE = '00110001'B
SAY 'TRUE BINARY HEX  = 'TRUE
SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
IF ¬TRUE THEN SAY 'NOT TRUE BINARY HEX'
IF TRUE THEN SAY 'YES, TRUE BINARY HEX'

TRUE = '0001'B
SAY 'TRUE BINARY ONLY = 'TRUE
SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
IF ¬TRUE THEN SAY 'NOT TRUE BINARY ONLY'
IF TRUE THEN SAY 'YES, TRUE BINARY ONLY'

ERROR2:
SIGNAL ON SYNTAX NAME ERROR3
TRUE = '1'B
SAY 'TRUE BINARY BIT  = 'TRUE
SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
IF ¬TRUE THEN SAY 'NOT TRUE BINARY BIT'
IF TRUE THEN SAY 'YES, TRUE BINARY BIT'

ERROR3:
EXIT 0


... which produces output:

TRUE NUMERIC   = 1
DATATYPE TRUE  = NUM
YES, TRUE NUMERIC
TRUE CHARACTER = 1
DATATYPE TRUE  = NUM
YES, TRUE CHARACTER
TRUE HEXADECIMAL = 1
DATATYPE TRUE  = NUM
YES, TRUE HEXADECIMAL
TRUE BINARY HEX  = 1
DATATYPE TRUE  = NUM
YES, TRUE BINARY HEX
TRUE BINARY ONLY = ?<--
DATATYPE TRUE  = CHAR   <--
TRUE BINARY BIT  = ?<--
DATATYPE TRUE  = CHAR   <--

PRESS ANY KEY TO CONTINUE.



On 08/09/2020 02:44, Seymour J Metz wrote:
> No. REXX has built in functions to test the value of a string, but it's all 
> strings
>
> foo =01
> bar = '01'
> baz = 0||1
>
> all yield the same value,
>
> shmuel@linux-gn5l:~> rexxtry
>   /usr/local/bin/rexxtry lets you interactively try REXX statements.
> Each string is executed when you hit Enter.
>   Enter 'call tell' for a description of the features.
>   Go on - try a few... Enter 'exit' to end.
> say datatype(01)
> NUM
>    /usr/local/bin/rexxtry on LINUX
> say datatype('01')
> NUM
>    /usr/local/bin/rexxtry on LINUX
> say datatype(0||1)
> NUM
>
>
>
>
>
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
>
>
> ________
> From: IBM Mainframe Discussion List  on behalf of 
> CM Poncelet 
> Sent: Monday, September 7, 2020 9:30 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: REXX true/false (was Constant Identifiers)
>
> No, REXX has both DATATYPE CHAR and NUM strings.
>
> Meanwhile C2D, D2X etc. would be useless if REXX could not then process
> binary data - as in IPCS REXX:
> ADDRESS IPCS
> PSA_ADDRESS = ''
> "EVALUATE" PSA_ADDRESS||. ,
>   "POSITION("X2D(224)") LENGTH(4) REXX(STORAGE(OLD_ASCB_ADDRESS))"
> "EVALUATE" OLD_ASCB_ADDRESS||. ,
>   "POSITION("X2D(6C)") LENGTH(4) REXX(STORAGE(OLD_ASXB_ADDRESS))"
> "EVALUATE" OLD_ASXB_ADDRESS||. ,
>   "POSITION("X2D(4)") LENGTH(4) REXX(STORAGE(TCB_CHAIN_START_ADDRESS))"
> "EVALUATE" OLD_ASXB_ADDRESS||. ,
>   "POSITION("X2D(8)") LENGTH(4) REXX(STORAGE(TCB_CHAIN_STOP_ADDRESS))"
> 
>
> My mistake was to think that setting a variable to a quoted value, in
> REXX, made that variable a type CHAR. But REXX considers it to be NUM if
> it contains only numerics, regardless of whether its set value was
> quoted or not. The oddity is that '0001'b etc. has DATATYPE CHAR
> instead of NUM in REXX. This would not happen in Fortran (type logical)
> or PL/I (DCL bit) or e

Re: REXX true/false (was Constant Identifiers)

2020-09-08 Thread CM Poncelet
A *character* string is either any string that has DATATYPE CHAR but not
DATATYPE NUM, or is *any* string (and it might as well then be called
'anything string' instead of 'character string').  
 
Q: "What's your motivation and the motivation of the recondite
examples you supplied (which I deleted) other than to
dispute Shmuel's reasonable assertion."  
A: "to dispute Shmuel's reasonable assertion." 
 
BTW "Are you just learning that not all languages are the same?  Rexx
doesn't even have a level-77." Nay, that REXX does not distinguish between 
quoted and unquoted data. 




On 08/09/2020 04:27, Paul Gilmartin wrote:
> On Tue, 8 Sep 2020 03:33:18 +0100, CM Poncelet wrote:
>
>> You said, "It isn't boolean; everything in REXX is a character string."
>> � 
>> I agree that "it's all strings", but not that "everything in REXX is a
>> *character* string."
>> �
> Persuing the Rexx Reference,  SA32-0972-40, I find various instances
> of "character string" to mean strings for which DATATYPE() would
> not return CHAR.  Particularly:
> Numbers:
> These are *character* strings consisting of one or more decimal 
> digits, ...
> (emphasis added)
>
> What's your motivation and the motivation of the recondite
> examples you supplied (which I deleted) other than to
> dispute Shmuel's reasonable assertion.
>
> Would you consider an RCF to the Ref. requesting a clarification of
> "character string"
>
>
>>> On 07/09/2020 06:52, Seymour J Metz wrote:
 It isn't boolean; everything in REXX is a character string.
> -- gil
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> .
>


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


Re: REXX true/false (was Constant Identifiers)

2020-09-07 Thread Paul Gilmartin
On Tue, 8 Sep 2020 03:33:18 +0100, CM Poncelet wrote:

>You said, "It isn't boolean; everything in REXX is a character string."
>� 
>I agree that "it's all strings", but not that "everything in REXX is a
>*character* string."
>�
Persuing the Rexx Reference,  SA32-0972-40, I find various instances
of "character string" to mean strings for which DATATYPE() would
not return CHAR.  Particularly:
Numbers:
These are *character* strings consisting of one or more decimal digits, 
...
(emphasis added)

What's your motivation and the motivation of the recondite
examples you supplied (which I deleted) other than to
dispute Shmuel's reasonable assertion.

Would you consider an RCF to the Ref. requesting a clarification of
"character string"


>> On 07/09/2020 06:52, Seymour J Metz wrote:
>>> It isn't boolean; everything in REXX is a character string.

-- gil

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


Re: REXX true/false (was Constant Identifiers)

2020-09-07 Thread CM Poncelet
You said, "It isn't boolean; everything in REXX is a character string."
 
I agree that "it's all strings", but not that "everything in REXX is a
*character* string."
 
Try the following:
 
ARG DEBUG
IF ABBREV(DEBUG,D,1) THEN ,
  TRACE I
 
SIGNAL ON SYNTAX NAME ERROR0
TRUE = 1
SAY 'TRUE NUMERIC   = 'TRUE
SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
IF ¬TRUE THEN SAY 'NOT TRUE NUMERIC'
IF TRUE THEN SAY 'YES, TRUE NUMERIC'

ERROR0:
SIGNAL ON SYNTAX NAME ERROR1
TRUE = '1'
SAY 'TRUE CHARACTER = 'TRUE
SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
IF ¬TRUE THEN SAY 'NOT TRUE CHARACTER'
IF TRUE THEN SAY 'YES, TRUE CHARACTER'

ERROR1:
SIGNAL ON SYNTAX NAME ERROR2
TRUE = '31'X
SAY 'TRUE HEXADECIMAL = 'TRUE
SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
IF ¬TRUE THEN SAY 'NOT TRUE HEXADECIMAL'
IF TRUE THEN SAY 'YES, TRUE HEXADECIMAL'

TRUE = '00110001'B
SAY 'TRUE BINARY HEX  = 'TRUE
SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
IF ¬TRUE THEN SAY 'NOT TRUE BINARY HEX'
IF TRUE THEN SAY 'YES, TRUE BINARY HEX'

TRUE = '0001'B
SAY 'TRUE BINARY ONLY = 'TRUE
SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
IF ¬TRUE THEN SAY 'NOT TRUE BINARY ONLY'
IF TRUE THEN SAY 'YES, TRUE BINARY ONLY'

ERROR2:
SIGNAL ON SYNTAX NAME ERROR3
TRUE = '1'B
SAY 'TRUE BINARY BIT  = 'TRUE
SAY 'DATATYPE TRUE  = 'DATATYPE(TRUE)
IF ¬TRUE THEN SAY 'NOT TRUE BINARY BIT'
IF TRUE THEN SAY 'YES, TRUE BINARY BIT'

ERROR3:
EXIT 0
 
 
... which produces output:
 
TRUE NUMERIC   = 1
DATATYPE TRUE  = NUM
YES, TRUE NUMERIC
TRUE CHARACTER = 1
DATATYPE TRUE  = NUM
YES, TRUE CHARACTER
TRUE HEXADECIMAL = 1
DATATYPE TRUE  = NUM
YES, TRUE HEXADECIMAL
TRUE BINARY HEX  = 1
DATATYPE TRUE  = NUM
YES, TRUE BINARY HEX
TRUE BINARY ONLY = ?    <--
DATATYPE TRUE  = CHAR   <--
TRUE BINARY BIT  = ?    <--
DATATYPE TRUE  = CHAR   <--

PRESS ANY KEY TO CONTINUE.
 
 

On 08/09/2020 02:44, Seymour J Metz wrote:
> No. REXX has built in functions to test the value of a string, but it's all 
> strings
>
> foo =01
> bar = '01'
> baz = 0||1
>
> all yield the same value,
>
> shmuel@linux-gn5l:~> rexxtry
>   /usr/local/bin/rexxtry lets you interactively try REXX statements.
> Each string is executed when you hit Enter.
>   Enter 'call tell' for a description of the features.
>   Go on - try a few... Enter 'exit' to end.
> say datatype(01)
> NUM
>    /usr/local/bin/rexxtry on LINUX
> say datatype('01')
> NUM
>    /usr/local/bin/rexxtry on LINUX
> say datatype(0||1)
> NUM
>
>
>
>
>
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
>
>
> 
> From: IBM Mainframe Discussion List  on behalf of 
> CM Poncelet 
> Sent: Monday, September 7, 2020 9:30 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: REXX true/false (was Constant Identifiers)
>
> No, REXX has both DATATYPE CHAR and NUM strings.
>
> Meanwhile C2D, D2X etc. would be useless if REXX could not then process
> binary data - as in IPCS REXX:
> ADDRESS IPCS
> PSA_ADDRESS = ''
> "EVALUATE" PSA_ADDRESS||. ,
>   "POSITION("X2D(224)") LENGTH(4) REXX(STORAGE(OLD_ASCB_ADDRESS))"
> "EVALUATE" OLD_ASCB_ADDRESS||. ,
>   "POSITION("X2D(6C)") LENGTH(4) REXX(STORAGE(OLD_ASXB_ADDRESS))"
> "EVALUATE" OLD_ASXB_ADDRESS||. ,
>   "POSITION("X2D(4)") LENGTH(4) REXX(STORAGE(TCB_CHAIN_START_ADDRESS))"
> "EVALUATE" OLD_ASXB_ADDRESS||. ,
>   "POSITION("X2D(8)") LENGTH(4) REXX(STORAGE(TCB_CHAIN_STOP_ADDRESS))"
> 
>
> My mistake was to think that setting a variable to a quoted value, in
> REXX, made that variable a type CHAR. But REXX considers it to be NUM if
> it contains only numerics, regardless of whether its set value was
> quoted or not. The oddity is that '0001'b etc. has DATATYPE CHAR
> instead of NUM in REXX. This would not happen in Fortran (type logical)
> or PL/I (DCL bit) or even COBOL (level-77 or -88, whatever it is).
>
>
>
> On 07/09/2020 06:52, Seymour J Metz wrote:
>> It isn't boolean; everything in REXX is a character string.
>>
>>
>> --
>> Shmuel (Seymour J.) Metz
>> http://mason.gmu.edu/~smetz3
>>
>>
>> 
>> From: IBM Mainframe Discussion List  on behalf of 
>> CM Poncelet 
>> Sent: Monday, September 7, 2020 1:30 AM
>> To: IBM-MAIN@LISTSERV.UA.EDU
>> Subject: Re: REXX true/false (was Constant Identifiers)
>>
>> "ELSE IF ¬TRUE THEN " was just to demonstrate that "TRUE" is 
>> Boolean.
>>
>>
>>
>> On 07/09/2020 05:24, Seymour J Metz wrote:
>>> First, that code is highly obfuscate

Re: REXX true/false (was Constant Identifiers)

2020-09-07 Thread Paul Gilmartin
On Tue, 8 Sep 2020 02:30:01 +0100, CM Poncelet  wrote:
>
>My mistake was to think that setting a variable to a quoted value, in
>REXX, made that variable a type CHAR. But REXX considers it to be NUM if
>it contains only numerics, regardless of whether its set value was
>
Not only numerics.  For example, DATATYPE( '-1.2E+3' ) is NUM even
though it contains 4 nonnumerics.

>quoted or not. The oddity is that '0001'b etc. has DATATYPE CHAR
>
Quoting is a matter of representation, not of value.  For example,
A=='A' is true because the values are identical.

>instead of NUM in REXX. This would not happen in Fortran (type logical)
>or PL/I (DCL bit) or even COBOL (level-77 or -88, whatever it is).
>
Are you just learning that not all languages are the same?  Rexx
doesn't even have a level-77.

But see: 
https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.3.0/com.ibm.zos.v2r3.ikja300/datatyp.htm

Hmm.  There I read:
The DATATYPE function tests the meaning or type of characters in a string,
independent of the encoding of those characters (for example, ASCII or 
EBCDIC).

What is that trying to say?  Does it mean that DATATYPE( '31'x ) (ASCII '1')
and DATATYPE( 'F1'x ) (EBCDIC 1) are both NUM?

(If they recognize DBCS, they should also recognize the prevalent UTF-8.)


>On 07/09/2020 06:52, Seymour J Metz wrote:
>> It isn't boolean; everything in REXX is a character string.
>>
What he said.

-- gil

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


Re: REXX true/false (was Constant Identifiers)

2020-09-07 Thread Seymour J Metz
No. REXX has built in functions to test the value of a string, but it's all 
strings

foo =01
bar = '01'
baz = 0||1

all yield the same value,

shmuel@linux-gn5l:~> rexxtry
  /usr/local/bin/rexxtry lets you interactively try REXX statements.
Each string is executed when you hit Enter.
  Enter 'call tell' for a description of the features.
  Go on - try a few... Enter 'exit' to end.
say datatype(01)
NUM
   /usr/local/bin/rexxtry on LINUX
say datatype('01')
NUM
   /usr/local/bin/rexxtry on LINUX
say datatype(0||1)
NUM






--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3



From: IBM Mainframe Discussion List  on behalf of CM 
Poncelet 
Sent: Monday, September 7, 2020 9:30 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: REXX true/false (was Constant Identifiers)

No, REXX has both DATATYPE CHAR and NUM strings.

Meanwhile C2D, D2X etc. would be useless if REXX could not then process
binary data - as in IPCS REXX:
ADDRESS IPCS
PSA_ADDRESS = ''
"EVALUATE" PSA_ADDRESS||. ,
  "POSITION("X2D(224)") LENGTH(4) REXX(STORAGE(OLD_ASCB_ADDRESS))"
"EVALUATE" OLD_ASCB_ADDRESS||. ,
  "POSITION("X2D(6C)") LENGTH(4) REXX(STORAGE(OLD_ASXB_ADDRESS))"
"EVALUATE" OLD_ASXB_ADDRESS||. ,
  "POSITION("X2D(4)") LENGTH(4) REXX(STORAGE(TCB_CHAIN_START_ADDRESS))"
"EVALUATE" OLD_ASXB_ADDRESS||. ,
  "POSITION("X2D(8)") LENGTH(4) REXX(STORAGE(TCB_CHAIN_STOP_ADDRESS))"


My mistake was to think that setting a variable to a quoted value, in
REXX, made that variable a type CHAR. But REXX considers it to be NUM if
it contains only numerics, regardless of whether its set value was
quoted or not. The oddity is that '0001'b etc. has DATATYPE CHAR
instead of NUM in REXX. This would not happen in Fortran (type logical)
or PL/I (DCL bit) or even COBOL (level-77 or -88, whatever it is).



On 07/09/2020 06:52, Seymour J Metz wrote:
> It isn't boolean; everything in REXX is a character string.
>
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
>
>
> 
> From: IBM Mainframe Discussion List  on behalf of 
> CM Poncelet 
> Sent: Monday, September 7, 2020 1:30 AM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: REXX true/false (was Constant Identifiers)
>
> "ELSE IF ¬TRUE THEN " was just to demonstrate that "TRUE" is 
> Boolean.
>
>
>
> On 07/09/2020 05:24, Seymour J Metz wrote:
>> First, that code is highly obfuscated. Why would you ever want to write "IF 
>> foo & TRUE" instead of "IF foo"?
>>
>> Second, "ELSE IF ¬TRUE THEN foo" is dead code.
>>
>> Third, there are no booleans in REXX; the only data type is character string.
>>
>>
>> --
>> Shmuel (Seymour J.) Metz
>> http://mason.gmu.edu/~smetz3
>>
>>
>> 
>> From: IBM Mainframe Discussion List  on behalf of 
>> CM Poncelet 
>> Sent: Sunday, September 6, 2020 9:31 PM
>> To: IBM-MAIN@LISTSERV.UA.EDU
>> Subject: Re: REXX true/false (was Constant Identifiers)
>>
>> In the following example,
>> TRUE = (1 - 1 = 0 & 1 ¬= 0) [or whatever is more appropriate],
>> it is then sufficient e.g. to code:
>> IF 4 ¬= 6 & TRUE THEN 
>> ELSE IF ¬TRUE THEN 
>>
>> I.e. TRUE can be defined as a Boolean '1'b in REXX, as per above.
>>
>> On 06/09/2020 20:43, Paul Gilmartin wrote:
>>> On Sun, 6 Sep 2020 12:03:18 -0400, scott Ford wrote:
>>>
>>>> I have done things like true =‘Y’ and then
>>>>
>>>> If true
>>>>  ..
>>>> end
>>>>
>>> What language?  That would certainly be a syntax error in Rexx.
>>> And why?  You could just omit the "if true" and code:
>>> do
>>> ..
>>> end
>>>
>>>
>>> n Sun, 6 Sep 2020 17:39:48 +, Seymour J Metz wrote:
>>>> A simple true=1;false=0 should suffice for clarity.
>>>>
>>> Perhaps not to someone most familiar with shell scripts
>>> where the definitions are nearly the opposite (command
>>> status ($?) = 0 means success or true).
>>>
>>>
>>> On Sun, 6 Sep 2020 17:43:04 +0100, Rupert Reynolds wrote:
>>>> The advantage of Boolean is clarity in something like:-
>>>> /* Rexx */
>>>> TRUE = (1=1)
>>>> ...
>>>> SELECT
>>>>  WHEN logmode = "D4A32782" & (GotASCII & GotVBMrecord)

Re: REXX true/false (was Constant Identifiers)

2020-09-07 Thread CM Poncelet
No, REXX has both DATATYPE CHAR and NUM strings.
 
Meanwhile C2D, D2X etc. would be useless if REXX could not then process
binary data - as in IPCS REXX:
ADDRESS IPCS
PSA_ADDRESS = ''
"EVALUATE" PSA_ADDRESS||. ,
  "POSITION("X2D(224)") LENGTH(4) REXX(STORAGE(OLD_ASCB_ADDRESS))"
"EVALUATE" OLD_ASCB_ADDRESS||. ,
  "POSITION("X2D(6C)") LENGTH(4) REXX(STORAGE(OLD_ASXB_ADDRESS))"
"EVALUATE" OLD_ASXB_ADDRESS||. ,
  "POSITION("X2D(4)") LENGTH(4) REXX(STORAGE(TCB_CHAIN_START_ADDRESS))"
"EVALUATE" OLD_ASXB_ADDRESS||. ,
  "POSITION("X2D(8)") LENGTH(4) REXX(STORAGE(TCB_CHAIN_STOP_ADDRESS))"

 
My mistake was to think that setting a variable to a quoted value, in
REXX, made that variable a type CHAR. But REXX considers it to be NUM if
it contains only numerics, regardless of whether its set value was
quoted or not. The oddity is that '0001'b etc. has DATATYPE CHAR
instead of NUM in REXX. This would not happen in Fortran (type logical)
or PL/I (DCL bit) or even COBOL (level-77 or -88, whatever it is).
 


On 07/09/2020 06:52, Seymour J Metz wrote:
> It isn't boolean; everything in REXX is a character string.
>
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
>
>
> 
> From: IBM Mainframe Discussion List  on behalf of 
> CM Poncelet 
> Sent: Monday, September 7, 2020 1:30 AM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: REXX true/false (was Constant Identifiers)
>
> "ELSE IF ¬TRUE THEN " was just to demonstrate that "TRUE" is 
> Boolean.
>
>
>
> On 07/09/2020 05:24, Seymour J Metz wrote:
>> First, that code is highly obfuscated. Why would you ever want to write "IF 
>> foo & TRUE" instead of "IF foo"?
>>
>> Second, "ELSE IF ¬TRUE THEN foo" is dead code.
>>
>> Third, there are no booleans in REXX; the only data type is character string.
>>
>>
>> --
>> Shmuel (Seymour J.) Metz
>> http://mason.gmu.edu/~smetz3
>>
>>
>> 
>> From: IBM Mainframe Discussion List  on behalf of 
>> CM Poncelet 
>> Sent: Sunday, September 6, 2020 9:31 PM
>> To: IBM-MAIN@LISTSERV.UA.EDU
>> Subject: Re: REXX true/false (was Constant Identifiers)
>>
>> In the following example,
>> TRUE = (1 - 1 = 0 & 1 ¬= 0) [or whatever is more appropriate],
>> it is then sufficient e.g. to code:
>> IF 4 ¬= 6 & TRUE THEN 
>> ELSE IF ¬TRUE THEN 
>>
>> I.e. TRUE can be defined as a Boolean '1'b in REXX, as per above.
>>
>> On 06/09/2020 20:43, Paul Gilmartin wrote:
>>> On Sun, 6 Sep 2020 12:03:18 -0400, scott Ford wrote:
>>>
>>>> I have done things like true =‘Y’ and then
>>>>
>>>> If true
>>>>  ..
>>>> end
>>>>
>>> What language?  That would certainly be a syntax error in Rexx.
>>> And why?  You could just omit the "if true" and code:
>>> do
>>> ..
>>> end
>>>
>>>
>>> n Sun, 6 Sep 2020 17:39:48 +, Seymour J Metz wrote:
>>>> A simple true=1;false=0 should suffice for clarity.
>>>>
>>> Perhaps not to someone most familiar with shell scripts
>>> where the definitions are nearly the opposite (command
>>> status ($?) = 0 means success or true).
>>>
>>>
>>> On Sun, 6 Sep 2020 17:43:04 +0100, Rupert Reynolds wrote:
>>>> The advantage of Boolean is clarity in something like:-
>>>> /* Rexx */
>>>> TRUE = (1=1)
>>>> ...
>>>> SELECT
>>>>  WHEN logmode = "D4A32782" & (GotASCII & GotVBMrecord) THEN do
>>>>...
>>> Continuing your example, how would you have set the variables
>>> "GotASCII" and "GotVBMrecord" using the quasi-constants TRUE
>>> and FALSE?  Does that enhance either clarity or economy of
>>> expression?
>>>
>>> I'm thinking that something like:
>>> if filetype=='ASCII' then GotASCII = TRUE; else GotASCII = FALSE
>>> would more succinctly be written:
>>> GotASCII = ( filetype=='ASCII' )
>>>
>>> But I've seen even worse, such as:
>>> if  GotASCII = true then ...
>>> rather than simply:
>>> if  GotASCII then ...
>>>
>>>
>>> On Sun, 6 Sep 2020 19:28:11 +, Seymour J Metz wrote:
>>>> Yes, you can count on the truth values of 0 and 1 in REXX never changing.

Re: REXX true/false (was Constant Identifiers)

2020-09-07 Thread Seymour J Metz
Well, my father was a journalist and a bibiliophile, so I was exposed to the 
ambiance early on, but I only started programming in 1960, in tenth grade, on a 
machine that absolutely immunized me against nostalgia.

If you think I'm old, I once saw a post from Werner Bucholz on this list. Gone, 
alas.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3



From: IBM Mainframe Discussion List  on behalf of Bob 
Bridges 
Sent: Monday, September 7, 2020 8:20 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: REXX true/false (was Constant Identifiers)

"Mehitabel" - wow!  You're a lot older than I assumed, Mr Metz!

---
Bob Bridges, robhbrid...@gmail.com, 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:IBM-MAIN@LISTSERV.UA.EDU] On
Behalf Of Seymour J Metz
Sent: Monday, September 7, 2020 14:53

Hindsight? I never understood the purpose of the web, given that gopher  and
SGML were already here. All we were missing was a protocol called Mehitabel
;-)


From: IBM Mainframe Discussion List  on behalf of
Rupert Reynolds 
Sent: Sunday, September 6, 2020 5:09 PM

Hindsight is a wonderful thing :-)

--- On Sun, 6 Sep 2020 at 21:55, Seymour J Metz  wrote:
> You didn't read The World According to ARPA? As for the WWW, I'd rather we
> had stuck to Gopher.
>
> 
> From: Rupert Reynolds 
> Sent: Sunday, September 6, 2020 4:48 PM
>
> Loss of Internet access would have been sheer luxury! (insert The Four
> Yorkshiremen sketch here) as this was the 1980s :-)  The Internet was
> there, but nobody had heard of it unless he was the sort of geek who
> soldered his own modem cable, and WWW was probably not even a twinkle in
> timbl's eye  :-)

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

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


Re: REXX true/false (was Constant Identifiers)

2020-09-07 Thread Bob Bridges
"Mehitabel" - wow!  You're a lot older than I assumed, Mr Metz!

---
Bob Bridges, robhbrid...@gmail.com, 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:IBM-MAIN@LISTSERV.UA.EDU] On
Behalf Of Seymour J Metz
Sent: Monday, September 7, 2020 14:53

Hindsight? I never understood the purpose of the web, given that gopher  and
SGML were already here. All we were missing was a protocol called Mehitabel
;-)


From: IBM Mainframe Discussion List  on behalf of
Rupert Reynolds 
Sent: Sunday, September 6, 2020 5:09 PM

Hindsight is a wonderful thing :-)

--- On Sun, 6 Sep 2020 at 21:55, Seymour J Metz  wrote:
> You didn't read The World According to ARPA? As for the WWW, I'd rather we
> had stuck to Gopher.
>
> 
> From: Rupert Reynolds 
> Sent: Sunday, September 6, 2020 4:48 PM
>
> Loss of Internet access would have been sheer luxury! (insert The Four
> Yorkshiremen sketch here) as this was the 1980s :-)  The Internet was
> there, but nobody had heard of it unless he was the sort of geek who
> soldered his own modem cable, and WWW was probably not even a twinkle in
> timbl's eye  :-)

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


Re: REXX true/false (was Constant Identifiers)

2020-09-07 Thread Paul Gilmartin
On Mon, 7 Sep 2020 18:52:55 +, Seymour J Metz wrote:

>Hindsight? I never understood the purpose of the web, given that gopher  and 
>SGML were already here. All we were missing was a protocol called Mehitabel ;-)
>
It's easy to understand.  Just remember, you're not the customer;
you're the product.

-- gil

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


Re: REXX true/false (was Constant Identifiers)

2020-09-07 Thread Seymour J Metz
Hindsight? I never understood the purpose of the web, given that gopher  and 
SGML were already here. All we were missing was a protocol called Mehitabel ;-)


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3



From: IBM Mainframe Discussion List  on behalf of 
Rupert Reynolds 
Sent: Sunday, September 6, 2020 5:09 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: REXX true/false (was Constant Identifiers)

Hindsight is a wonderful thing :-)

On Sun, 6 Sep 2020 at 21:55, Seymour J Metz  wrote:

> You didn't read The World According to ARPA? As for the WWW, I'd rather we
> had stuck to Gopher.
>
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
>
>
> 
> From: IBM Mainframe Discussion List  on behalf
> of Rupert Reynolds 
> Sent: Sunday, September 6, 2020 4:48 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: REXX true/false (was Constant Identifiers)
>
> Loss of Internet access would have been sheer luxury! (insert The Four
> Yorkshiremen sketch here) as this was the 1980s :-)  The Internet was
> there, but nobody had heard of it unless he was the sort of geek who
> soldered his own modem cable, and WWW was probably not even a twinkle in
> timbl's eye  :-)
>
> On Sun, 6 Sep 2020 at 20:56, Seymour J Metz  wrote:
>
> > All REXX implementations use 0 and 1 for false and true. But I agree that
> > loss of Internet access is crippling. May this be the last time.
> >
> >
> > --
> > Shmuel (Seymour J.) Metz
>
>

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

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


Re: REXX true/false (was Constant Identifiers)

2020-09-07 Thread Seymour J Metz
The value 00110001 in REXX is an 8 character string. The value '00110001'b in 
PL/I is an 8 bit string. The REXX equivalent would be X2C(B2X(00110001)).

--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3



From: IBM Mainframe Discussion List  on behalf of CM 
Poncelet 
Sent: Monday, September 7, 2020 1:23 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: REXX true/false (was Constant Identifiers)

ARG DEBUG
IF DEBUG = 'DEBUG' THEN ,
  TRACE I
TRUE = (1-1=0 & 4¬=6)
TVAL = '0011'||X2B(D2X(TRUE))
SAY 'TRUE = 'TRUE
SAY 'TVAL = 'TVAL
IF TRUE THEN SAY 'TRUE'
IF TVAL THEN SAY 'TVAL'
IF ¬TRUE THEN SAY 'NOT TRUE'
IF ¬TVAL THEN SAY 'NOT TVAL'
EXIT 0

gives (in ASCII):

TRUE = 1
TVAL = 00110001
TRUE
TRUEFALS(9): Error #34, Logical value not 0 or 1
IF TVAL THEN SAY 'TVAL'

PRESS ANY KEY TO CONTINUE.

;-)



On 07/09/2020 03:23, Paul Gilmartin wrote:
> On Mon, 7 Sep 2020 02:31:33 +0100, CM Poncelet wrote:
>
>> In the following example,
>> TRUE = (1 - 1 = 0 & 1 ¬= 0) [or whatever is more appropriate],
>> it is then sufficient e.g. to code:
>> IF 4 ¬= 6 & TRUE THEN 
>> ELSE IF ¬TRUE THEN 
>>
>> I.e. TRUE can be defined as a Boolean '1'b in REXX, as per above.
>>
> No.  In Rexx the only legal Boolean values are:
>FALSETRUE
> ''b  '0001'b  EBCDIC
> '0011'b  '00110001'b  ASCII
>
> -- gil
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> .
>

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

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


Re: REXX true/false (was Constant Identifiers)

2020-09-06 Thread Seymour J Metz
It isn't boolean; everything in REXX is a character string.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3



From: IBM Mainframe Discussion List  on behalf of CM 
Poncelet 
Sent: Monday, September 7, 2020 1:30 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: REXX true/false (was Constant Identifiers)

"ELSE IF ¬TRUE THEN " was just to demonstrate that "TRUE" is 
Boolean.



On 07/09/2020 05:24, Seymour J Metz wrote:
> First, that code is highly obfuscated. Why would you ever want to write "IF 
> foo & TRUE" instead of "IF foo"?
>
> Second, "ELSE IF ¬TRUE THEN foo" is dead code.
>
> Third, there are no booleans in REXX; the only data type is character string.
>
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
>
>
> 
> From: IBM Mainframe Discussion List  on behalf of 
> CM Poncelet 
> Sent: Sunday, September 6, 2020 9:31 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: REXX true/false (was Constant Identifiers)
>
> In the following example,
> TRUE = (1 - 1 = 0 & 1 ¬= 0) [or whatever is more appropriate],
> it is then sufficient e.g. to code:
> IF 4 ¬= 6 & TRUE THEN 
> ELSE IF ¬TRUE THEN 
>
> I.e. TRUE can be defined as a Boolean '1'b in REXX, as per above.
>
> On 06/09/2020 20:43, Paul Gilmartin wrote:
>> On Sun, 6 Sep 2020 12:03:18 -0400, scott Ford wrote:
>>
>>> I have done things like true =‘Y’ and then
>>>
>>> If true
>>>  ..
>>> end
>>>
>> What language?  That would certainly be a syntax error in Rexx.
>> And why?  You could just omit the "if true" and code:
>> do
>> ..
>> end
>>
>>
>> n Sun, 6 Sep 2020 17:39:48 +, Seymour J Metz wrote:
>>> A simple true=1;false=0 should suffice for clarity.
>>>
>> Perhaps not to someone most familiar with shell scripts
>> where the definitions are nearly the opposite (command
>> status ($?) = 0 means success or true).
>>
>>
>> On Sun, 6 Sep 2020 17:43:04 +0100, Rupert Reynolds wrote:
>>> The advantage of Boolean is clarity in something like:-
>>> /* Rexx */
>>> TRUE = (1=1)
>>> ...
>>> SELECT
>>>  WHEN logmode = "D4A32782" & (GotASCII & GotVBMrecord) THEN do
>>>...
>> Continuing your example, how would you have set the variables
>> "GotASCII" and "GotVBMrecord" using the quasi-constants TRUE
>> and FALSE?  Does that enhance either clarity or economy of
>> expression?
>>
>> I'm thinking that something like:
>> if filetype=='ASCII' then GotASCII = TRUE; else GotASCII = FALSE
>> would more succinctly be written:
>> GotASCII = ( filetype=='ASCII' )
>>
>> But I've seen even worse, such as:
>> if  GotASCII = true then ...
>> rather than simply:
>> if  GotASCII then ...
>>
>>
>> On Sun, 6 Sep 2020 19:28:11 +, Seymour J Metz wrote:
>>> Yes, you can count on the truth values of 0 and 1 in REXX never changing.
>>>
>> Only if I spent $60 for the ANSI Standard .pdf
>>
>> -- gil
>>
>> --
>> For IBM-MAIN subscribe / signoff / archive access instructions,
>> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>> .
>>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> .
>

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

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


Re: REXX true/false (was Constant Identifiers)

2020-09-06 Thread CM Poncelet
"ELSE IF ¬TRUE THEN " was just to demonstrate that "TRUE" is 
Boolean. 



On 07/09/2020 05:24, Seymour J Metz wrote:
> First, that code is highly obfuscated. Why would you ever want to write "IF 
> foo & TRUE" instead of "IF foo"?
>
> Second, "ELSE IF ¬TRUE THEN foo" is dead code.
>
> Third, there are no booleans in REXX; the only data type is character string. 
>
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
>
>
> 
> From: IBM Mainframe Discussion List  on behalf of 
> CM Poncelet 
> Sent: Sunday, September 6, 2020 9:31 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: REXX true/false (was Constant Identifiers)
>
> In the following example,
> TRUE = (1 - 1 = 0 & 1 ¬= 0) [or whatever is more appropriate],
> it is then sufficient e.g. to code:
> IF 4 ¬= 6 & TRUE THEN 
> ELSE IF ¬TRUE THEN 
>
> I.e. TRUE can be defined as a Boolean '1'b in REXX, as per above.
>
> On 06/09/2020 20:43, Paul Gilmartin wrote:
>> On Sun, 6 Sep 2020 12:03:18 -0400, scott Ford wrote:
>>
>>> I have done things like true =‘Y’ and then
>>>
>>> If true
>>>  ..
>>> end
>>>
>> What language?  That would certainly be a syntax error in Rexx.
>> And why?  You could just omit the "if true" and code:
>> do
>> ..
>> end
>>
>>
>> n Sun, 6 Sep 2020 17:39:48 +, Seymour J Metz wrote:
>>> A simple true=1;false=0 should suffice for clarity.
>>>
>> Perhaps not to someone most familiar with shell scripts
>> where the definitions are nearly the opposite (command
>> status ($?) = 0 means success or true).
>>
>>
>> On Sun, 6 Sep 2020 17:43:04 +0100, Rupert Reynolds wrote:
>>> The advantage of Boolean is clarity in something like:-
>>> /* Rexx */
>>> TRUE = (1=1)
>>> ...
>>> SELECT
>>>  WHEN logmode = "D4A32782" & (GotASCII & GotVBMrecord) THEN do
>>>...
>> Continuing your example, how would you have set the variables
>> "GotASCII" and "GotVBMrecord" using the quasi-constants TRUE
>> and FALSE?  Does that enhance either clarity or economy of
>> expression?
>>
>> I'm thinking that something like:
>> if filetype=='ASCII' then GotASCII = TRUE; else GotASCII = FALSE
>> would more succinctly be written:
>> GotASCII = ( filetype=='ASCII' )
>>
>> But I've seen even worse, such as:
>> if  GotASCII = true then ...
>> rather than simply:
>> if  GotASCII then ...
>>
>>
>> On Sun, 6 Sep 2020 19:28:11 +, Seymour J Metz wrote:
>>> Yes, you can count on the truth values of 0 and 1 in REXX never changing.
>>>
>> Only if I spent $60 for the ANSI Standard .pdf
>>
>> -- gil
>>
>> --
>> For IBM-MAIN subscribe / signoff / archive access instructions,
>> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>> .
>>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> .
>

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


Re: REXX true/false (was Constant Identifiers)

2020-09-06 Thread CM Poncelet
ARG DEBUG
IF DEBUG = 'DEBUG' THEN ,
  TRACE I
TRUE = (1-1=0 & 4¬=6)
TVAL = '0011'||X2B(D2X(TRUE))
SAY 'TRUE = 'TRUE
SAY 'TVAL = 'TVAL
IF TRUE THEN SAY 'TRUE'
IF TVAL THEN SAY 'TVAL'
IF ¬TRUE THEN SAY 'NOT TRUE'
IF ¬TVAL THEN SAY 'NOT TVAL'
EXIT 0
 
gives (in ASCII):
 
TRUE = 1
TVAL = 00110001
TRUE
TRUEFALS(9): Error #34, Logical value not 0 or 1
IF TVAL THEN SAY 'TVAL'

PRESS ANY KEY TO CONTINUE.
 
;-)
 


On 07/09/2020 03:23, Paul Gilmartin wrote:
> On Mon, 7 Sep 2020 02:31:33 +0100, CM Poncelet wrote:
>
>> In the following example,
>> TRUE = (1 - 1 = 0 & 1 ¬= 0) [or whatever is more appropriate],
>> it is then sufficient e.g. to code:
>> IF 4 ¬= 6 & TRUE THEN 
>> ELSE IF ¬TRUE THEN 
>>  
>> I.e. TRUE can be defined as a Boolean '1'b in REXX, as per above.
>>
> No.  In Rexx the only legal Boolean values are:
>FALSETRUE
> ''b  '0001'b  EBCDIC
> '0011'b  '00110001'b  ASCII
>
> -- gil
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> .
>

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


Re: REXX true/false (was Constant Identifiers)

2020-09-06 Thread Seymour J Metz
First, that code is highly obfuscated. Why would you ever want to write "IF foo 
& TRUE" instead of "IF foo"?

Second, "ELSE IF ¬TRUE THEN foo" is dead code.

Third, there are no booleans in REXX; the only data type is character string. 


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3



From: IBM Mainframe Discussion List  on behalf of CM 
Poncelet 
Sent: Sunday, September 6, 2020 9:31 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: REXX true/false (was Constant Identifiers)

In the following example,
TRUE = (1 - 1 = 0 & 1 ¬= 0) [or whatever is more appropriate],
it is then sufficient e.g. to code:
IF 4 ¬= 6 & TRUE THEN 
ELSE IF ¬TRUE THEN 

I.e. TRUE can be defined as a Boolean '1'b in REXX, as per above.

On 06/09/2020 20:43, Paul Gilmartin wrote:
> On Sun, 6 Sep 2020 12:03:18 -0400, scott Ford wrote:
>
>> I have done things like true =‘Y’ and then
>>
>> If true
>>  ..
>> end
>>
> What language?  That would certainly be a syntax error in Rexx.
> And why?  You could just omit the "if true" and code:
> do
> ..
> end
>
>
> n Sun, 6 Sep 2020 17:39:48 +, Seymour J Metz wrote:
>> A simple true=1;false=0 should suffice for clarity.
>>
> Perhaps not to someone most familiar with shell scripts
> where the definitions are nearly the opposite (command
> status ($?) = 0 means success or true).
>
>
> On Sun, 6 Sep 2020 17:43:04 +0100, Rupert Reynolds wrote:
>> The advantage of Boolean is clarity in something like:-
>> /* Rexx */
>> TRUE = (1=1)
>> ...
>> SELECT
>>  WHEN logmode = "D4A32782" & (GotASCII & GotVBMrecord) THEN do
>>...
> Continuing your example, how would you have set the variables
> "GotASCII" and "GotVBMrecord" using the quasi-constants TRUE
> and FALSE?  Does that enhance either clarity or economy of
> expression?
>
> I'm thinking that something like:
> if filetype=='ASCII' then GotASCII = TRUE; else GotASCII = FALSE
> would more succinctly be written:
> GotASCII = ( filetype=='ASCII' )
>
> But I've seen even worse, such as:
> if  GotASCII = true then ...
> rather than simply:
> if  GotASCII then ...
>
>
> On Sun, 6 Sep 2020 19:28:11 +, Seymour J Metz wrote:
>> Yes, you can count on the truth values of 0 and 1 in REXX never changing.
>>
> Only if I spent $60 for the ANSI Standard .pdf
>
> -- gil
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> .
>

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

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


Re: REXX true/false (was Constant Identifiers)

2020-09-06 Thread Bob Bridges
 Because I wasn't paying attention, I guess. Maybe I did do it that
way in the past, but just now the below is what I remembered.  Absent of me.

---
Bob Bridges, robhbrid...@gmail.com, cell 336 382-7313

/* God's never been disappointed in me, because he never had any illusions
about me.  -Clay McLean */

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
Behalf Of Jeremy Nicoll
Sent: Saturday, September 5, 2020 17:18

Why   (0-fx)+2when  2-fxis simpler?

--- On Sat, 5 Sep 2020, at 21:09, Bob Bridges wrote:
>  I've never done that, but I have done something like it:
> 
>   str=word('true false',(0-fx)+2)

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


Re: REXX true/false (was Constant Identifiers)

2020-09-06 Thread Paul Gilmartin
On Mon, 7 Sep 2020 02:31:33 +0100, CM Poncelet wrote:

>In the following example,
>TRUE = (1 - 1 = 0 & 1 ¬= 0) [or whatever is more appropriate],
>it is then sufficient e.g. to code:
>IF 4 ¬= 6 & TRUE THEN 
>ELSE IF ¬TRUE THEN 
> 
>I.e. TRUE can be defined as a Boolean '1'b in REXX, as per above.
> 
No.  In Rexx the only legal Boolean values are:
   FALSETRUE
''b  '0001'b  EBCDIC
'0011'b  '00110001'b  ASCII

-- gil

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


Re: REXX true/false (was Constant Identifiers)

2020-09-06 Thread CM Poncelet
In the following example,
TRUE = (1 - 1 = 0 & 1 ¬= 0) [or whatever is more appropriate],
it is then sufficient e.g. to code:
IF 4 ¬= 6 & TRUE THEN 
ELSE IF ¬TRUE THEN 
 
I.e. TRUE can be defined as a Boolean '1'b in REXX, as per above.

On 06/09/2020 20:43, Paul Gilmartin wrote:
> On Sun, 6 Sep 2020 12:03:18 -0400, scott Ford wrote:
>
>> I have done things like true =‘Y’ and then
>>
>> If true
>>  ..
>> end
>>
> What language?  That would certainly be a syntax error in Rexx.
> And why?  You could just omit the "if true" and code:
> do
> ..
> end
>
>
> n Sun, 6 Sep 2020 17:39:48 +, Seymour J Metz wrote:
>> A simple true=1;false=0 should suffice for clarity.
>>
> Perhaps not to someone most familiar with shell scripts
> where the definitions are nearly the opposite (command
> status ($?) = 0 means success or true).
>
>
> On Sun, 6 Sep 2020 17:43:04 +0100, Rupert Reynolds wrote:
>> The advantage of Boolean is clarity in something like:-
>> /* Rexx */
>> TRUE = (1=1)
>> ...
>> SELECT
>>  WHEN logmode = "D4A32782" & (GotASCII & GotVBMrecord) THEN do
>>...
> Continuing your example, how would you have set the variables
> "GotASCII" and "GotVBMrecord" using the quasi-constants TRUE
> and FALSE?  Does that enhance either clarity or economy of
> expression?
>
> I'm thinking that something like:
> if filetype=='ASCII' then GotASCII = TRUE; else GotASCII = FALSE
> would more succinctly be written:
> GotASCII = ( filetype=='ASCII' )
>
> But I've seen even worse, such as:
> if  GotASCII = true then ...
> rather than simply:
> if  GotASCII then ...
>
>
> On Sun, 6 Sep 2020 19:28:11 +, Seymour J Metz wrote:
>> Yes, you can count on the truth values of 0 and 1 in REXX never changing.
>>
> Only if I spent $60 for the ANSI Standard .pdf
>
> -- gil
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> .
>

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


Re: REXX true/false (was Constant Identifiers)

2020-09-06 Thread Rupert Reynolds
Hindsight is a wonderful thing :-)

On Sun, 6 Sep 2020 at 21:55, Seymour J Metz  wrote:

> You didn't read The World According to ARPA? As for the WWW, I'd rather we
> had stuck to Gopher.
>
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
>
>
> 
> From: IBM Mainframe Discussion List  on behalf
> of Rupert Reynolds 
> Sent: Sunday, September 6, 2020 4:48 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: REXX true/false (was Constant Identifiers)
>
> Loss of Internet access would have been sheer luxury! (insert The Four
> Yorkshiremen sketch here) as this was the 1980s :-)  The Internet was
> there, but nobody had heard of it unless he was the sort of geek who
> soldered his own modem cable, and WWW was probably not even a twinkle in
> timbl's eye  :-)
>
> On Sun, 6 Sep 2020 at 20:56, Seymour J Metz  wrote:
>
> > All REXX implementations use 0 and 1 for false and true. But I agree that
> > loss of Internet access is crippling. May this be the last time.
> >
> >
> > --
> > Shmuel (Seymour J.) Metz
>
>

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


Re: REXX true/false (was Constant Identifiers)

2020-09-06 Thread Seymour J Metz
You didn't read The World According to ARPA? As for the WWW, I'd rather we had 
stuck to Gopher.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3



From: IBM Mainframe Discussion List  on behalf of 
Rupert Reynolds 
Sent: Sunday, September 6, 2020 4:48 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: REXX true/false (was Constant Identifiers)

Loss of Internet access would have been sheer luxury! (insert The Four
Yorkshiremen sketch here) as this was the 1980s :-)  The Internet was
there, but nobody had heard of it unless he was the sort of geek who
soldered his own modem cable, and WWW was probably not even a twinkle in
timbl's eye  :-)

On Sun, 6 Sep 2020 at 20:56, Seymour J Metz  wrote:

> All REXX implementations use 0 and 1 for false and true. But I agree that
> loss of Internet access is crippling. May this be the last time.
>
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
>
>
>

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

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


Re: REXX true/false (was Constant Identifiers)

2020-09-06 Thread Rupert Reynolds
Loss of Internet access would have been sheer luxury! (insert The Four
Yorkshiremen sketch here) as this was the 1980s :-)  The Internet was
there, but nobody had heard of it unless he was the sort of geek who
soldered his own modem cable, and WWW was probably not even a twinkle in
timbl's eye  :-)

On Sun, 6 Sep 2020 at 20:56, Seymour J Metz  wrote:

> All REXX implementations use 0 and 1 for false and true. But I agree that
> loss of Internet access is crippling. May this be the last time.
>
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
>
>
>

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


Re: REXX true/false (was Constant Identifiers)

2020-09-06 Thread Seymour J Metz
All REXX implementations use 0 and 1 for false and true. But I agree that loss 
of Internet access is crippling. May this be the last time.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3



From: IBM Mainframe Discussion List  on behalf of 
Rupert Reynolds 
Sent: Sunday, September 6, 2020 3:45 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: REXX true/false (was Constant Identifiers)

It almost boils down to a matter of style, I suppose. The only thing
against that is that I had no access to any sort of docs, as I said. I had
no way of knowing whether 1 always represents Boolean true, or whether it's
implementation dependent. TRUE = (1=1) acts as a reminder.

/Now/ I have access to the docs, but I only write for Regina Rexx and for
my own use, so it doesn't matter so much. I'm porting something, and Rexx's
string handling and stems make it a clear choice for this job :-)

Rupert

On Sun, 6 Sep 2020 at 18:39, Seymour J Metz  wrote:

> A simple true=1;false=0 should suffice for clarity.
>
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
>
>
> 
> From: IBM Mainframe Discussion List  on behalf
> of Rupert Reynolds 
> Sent: Sunday, September 6, 2020 12:43 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: REXX true/false (was Constant Identifiers)
>
> I don't see any advantage in 'Y', because then you have to code IF or WHEN
> variable = 'Y'.
>
> The advantage of Boolean is clarity in something like:-
> /* Rexx */
> TRUE = (1=1)
> ...
> SELECT
>   WHEN logmode = "D4A32782" & (GotASCII & GotVBMrecord) THEN do
>
> (from a similar exec I found in archives, not the same one)
>
> The disadvantage is that it looks and works like a constant, but it's a
> variable.
>
> Rupert
>
> On Sun, 6 Sep 2020 at 17:03, scott Ford  wrote:
>
> > I have done things like true =‘Y’ and then
> >
> > If true
> >   ..
> > end
> >
> >
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

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

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


Re: REXX true/false (was Constant Identifiers)

2020-09-06 Thread Rupert Reynolds
It almost boils down to a matter of style, I suppose. The only thing
against that is that I had no access to any sort of docs, as I said. I had
no way of knowing whether 1 always represents Boolean true, or whether it's
implementation dependent. TRUE = (1=1) acts as a reminder.

/Now/ I have access to the docs, but I only write for Regina Rexx and for
my own use, so it doesn't matter so much. I'm porting something, and Rexx's
string handling and stems make it a clear choice for this job :-)

Rupert

On Sun, 6 Sep 2020 at 18:39, Seymour J Metz  wrote:

> A simple true=1;false=0 should suffice for clarity.
>
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
>
>
> 
> From: IBM Mainframe Discussion List  on behalf
> of Rupert Reynolds 
> Sent: Sunday, September 6, 2020 12:43 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: REXX true/false (was Constant Identifiers)
>
> I don't see any advantage in 'Y', because then you have to code IF or WHEN
> variable = 'Y'.
>
> The advantage of Boolean is clarity in something like:-
> /* Rexx */
> TRUE = (1=1)
> ...
> SELECT
>   WHEN logmode = "D4A32782" & (GotASCII & GotVBMrecord) THEN do
>
> (from a similar exec I found in archives, not the same one)
>
> The disadvantage is that it looks and works like a constant, but it's a
> variable.
>
> Rupert
>
> On Sun, 6 Sep 2020 at 17:03, scott Ford  wrote:
>
> > I have done things like true =‘Y’ and then
> >
> > If true
> >   ..
> > end
> >
> >
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

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


Re: REXX true/false (was Constant Identifiers)

2020-09-06 Thread Paul Gilmartin
On Sun, 6 Sep 2020 12:03:18 -0400, scott Ford wrote:

>I have done things like true =‘Y’ and then
>
>If true
>  ..
>end
> 
What language?  That would certainly be a syntax error in Rexx.
And why?  You could just omit the "if true" and code:
do
..
end


n Sun, 6 Sep 2020 17:39:48 +, Seymour J Metz wrote:
>
>A simple true=1;false=0 should suffice for clarity.
>
Perhaps not to someone most familiar with shell scripts
where the definitions are nearly the opposite (command
status ($?) = 0 means success or true).


On Sun, 6 Sep 2020 17:43:04 +0100, Rupert Reynolds wrote:
>
>The advantage of Boolean is clarity in something like:-
>/* Rexx */
>TRUE = (1=1)
>...
>SELECT
>  WHEN logmode = "D4A32782" & (GotASCII & GotVBMrecord) THEN do
>...
Continuing your example, how would you have set the variables
"GotASCII" and "GotVBMrecord" using the quasi-constants TRUE
and FALSE?  Does that enhance either clarity or economy of
expression?

I'm thinking that something like:
if filetype=='ASCII' then GotASCII = TRUE; else GotASCII = FALSE
would more succinctly be written:
GotASCII = ( filetype=='ASCII' )

But I've seen even worse, such as:
if  GotASCII = true then ...
rather than simply:
if  GotASCII then ...


On Sun, 6 Sep 2020 19:28:11 +, Seymour J Metz wrote:
>
>Yes, you can count on the truth values of 0 and 1 in REXX never changing.
>
Only if I spent $60 for the ANSI Standard .pdf

-- gil

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


Re: REXX true/false (was Constant Identifiers)

2020-09-06 Thread Seymour J Metz
Yes, you can count on the truth values of 0 and 1 in REXX never changing.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3



From: IBM Mainframe Discussion List  on behalf of 
Rupert Reynolds 
Sent: Sunday, September 6, 2020 8:12 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: REXX true/false (was Constant Identifiers)

To expand, I had some code monitoring input data as it arrived, waiting for
a fault condition that was in several parts, order unknown.

So I used a few Rexx variables as Booleans, as they made the conditional
code shorter and clearer.

But someone will reuse my code another day (perhaps me), and without the
WWW or access to the proper Rexx docs, can I rely on '1' and '0' always
being equivalent to the Boolean true and false, in every version of every
interpreter and perhaps compilers as well?

This was not like (say) PL/1, in which a bit(1) with the value '1'b had a
precise meaning for Boolean logic, stated in a book already sat on my desk
:-)

Using TRUE and FALSE like constants from the top made it clear to anyone
viewing it, and fairly easy to find and change in the code, if necessary.

It worked, BTW. As I remember things, it found the bug before my coffee mug
was empty, but a few days later they cancelled the software licence over a
different, bigger bug. Ho-hum :-)

Rupert

On Sat., Sep. 5, 2020, 23:56 Paul Gilmartin, <
000433f07816-dmarc-requ...@listserv.ua.edu> wrote:

> On Sat, 5 Sep 2020 23:36:37 +0100, Rupert Reynolds wrote:
>
> >Writing Rexx for myself (therefore no local standards to follow) I had to
> >set an internal boolean in a few places.
> >So I started it with
> >TRUE = (1=1)
> >FALSE = \TRUE
> >
> Now you have them; how are they useful?  (Examples?)
>
> >That's partly because I couldn't find doc on Rexx standards (no WWW yet)
> >and I didn't like to assume that 1 and 0 were always valid :-)
>
>

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

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


Re: REXX true/false (was Constant Identifiers)

2020-09-06 Thread Seymour J Metz
Why? I don't even see why it would work, and it certainly does add clarity.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3



From: IBM Mainframe Discussion List  on behalf of 
scott Ford 
Sent: Sunday, September 6, 2020 12:03 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: REXX true/false (was Constant Identifiers)

I have done things like true =‘Y’ and then

If true
  ..
end

Scott

On Sun, Sep 6, 2020 at 8:11 AM Rupert Reynolds  wrote:

> To expand, I had some code monitoring input data as it arrived, waiting for
>
> a fault condition that was in several parts, order unknown.
>
>
>
> So I used a few Rexx variables as Booleans, as they made the conditional
>
> code shorter and clearer.
>
>
>
> But someone will reuse my code another day (perhaps me), and without the
>
> WWW or access to the proper Rexx docs, can I rely on '1' and '0' always
>
> being equivalent to the Boolean true and false, in every version of every
>
> interpreter and perhaps compilers as well?
>
>
>
> This was not like (say) PL/1, in which a bit(1) with the value '1'b had a
>
> precise meaning for Boolean logic, stated in a book already sat on my desk
>
> :-)
>
>
>
> Using TRUE and FALSE like constants from the top made it clear to anyone
>
> viewing it, and fairly easy to find and change in the code, if necessary.
>
>
>
> It worked, BTW. As I remember things, it found the bug before my coffee mug
>
> was empty, but a few days later they cancelled the software licence over a
>
> different, bigger bug. Ho-hum :-)
>
>
>
> Rupert
>
>
>
> On Sat., Sep. 5, 2020, 23:56 Paul Gilmartin, <
>
> 000433f07816-dmarc-requ...@listserv.ua.edu> wrote:
>
>
>
> > On Sat, 5 Sep 2020 23:36:37 +0100, Rupert Reynolds wrote:
>
> >
>
> > >Writing Rexx for myself (therefore no local standards to follow) I had
> to
>
> > >set an internal boolean in a few places.
>
> > >So I started it with
>
> > >TRUE = (1=1)
>
> > >FALSE = \TRUE
>
> > >
>
> > Now you have them; how are they useful?  (Examples?)
>
> >
>
> > >That's partly because I couldn't find doc on Rexx standards (no WWW yet)
>
> > >and I didn't like to assume that 1 and 0 were always valid :-)
>
> >
>
> >
>
>
>
> --
>
> For IBM-MAIN subscribe / signoff / archive access instructions,
>
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>
> --
Scott Ford
IDMWORKS
z/OS Development

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

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


Re: REXX true/false (was Constant Identifiers)

2020-09-06 Thread Seymour J Metz
A simple true=1;false=0 should suffice for clarity.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3



From: IBM Mainframe Discussion List  on behalf of 
Rupert Reynolds 
Sent: Sunday, September 6, 2020 12:43 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: REXX true/false (was Constant Identifiers)

I don't see any advantage in 'Y', because then you have to code IF or WHEN
variable = 'Y'.

The advantage of Boolean is clarity in something like:-
/* Rexx */
TRUE = (1=1)
...
SELECT
  WHEN logmode = "D4A32782" & (GotASCII & GotVBMrecord) THEN do

(from a similar exec I found in archives, not the same one)

The disadvantage is that it looks and works like a constant, but it's a
variable.

Rupert

On Sun, 6 Sep 2020 at 17:03, scott Ford  wrote:

> I have done things like true =‘Y’ and then
>
> If true
>   ..
> end
>
>

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

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


Re: REXX true/false (was Constant Identifiers)

2020-09-06 Thread Rupert Reynolds
I don't see any advantage in 'Y', because then you have to code IF or WHEN
variable = 'Y'.

The advantage of Boolean is clarity in something like:-
/* Rexx */
TRUE = (1=1)
...
SELECT
  WHEN logmode = "D4A32782" & (GotASCII & GotVBMrecord) THEN do

(from a similar exec I found in archives, not the same one)

The disadvantage is that it looks and works like a constant, but it's a
variable.

Rupert

On Sun, 6 Sep 2020 at 17:03, scott Ford  wrote:

> I have done things like true =‘Y’ and then
>
> If true
>   ..
> end
>
>

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


Re: REXX true/false (was Constant Identifiers)

2020-09-06 Thread scott Ford
I have done things like true =‘Y’ and then

If true
  ..
end

Scott

On Sun, Sep 6, 2020 at 8:11 AM Rupert Reynolds  wrote:

> To expand, I had some code monitoring input data as it arrived, waiting for
>
> a fault condition that was in several parts, order unknown.
>
>
>
> So I used a few Rexx variables as Booleans, as they made the conditional
>
> code shorter and clearer.
>
>
>
> But someone will reuse my code another day (perhaps me), and without the
>
> WWW or access to the proper Rexx docs, can I rely on '1' and '0' always
>
> being equivalent to the Boolean true and false, in every version of every
>
> interpreter and perhaps compilers as well?
>
>
>
> This was not like (say) PL/1, in which a bit(1) with the value '1'b had a
>
> precise meaning for Boolean logic, stated in a book already sat on my desk
>
> :-)
>
>
>
> Using TRUE and FALSE like constants from the top made it clear to anyone
>
> viewing it, and fairly easy to find and change in the code, if necessary.
>
>
>
> It worked, BTW. As I remember things, it found the bug before my coffee mug
>
> was empty, but a few days later they cancelled the software licence over a
>
> different, bigger bug. Ho-hum :-)
>
>
>
> Rupert
>
>
>
> On Sat., Sep. 5, 2020, 23:56 Paul Gilmartin, <
>
> 000433f07816-dmarc-requ...@listserv.ua.edu> wrote:
>
>
>
> > On Sat, 5 Sep 2020 23:36:37 +0100, Rupert Reynolds wrote:
>
> >
>
> > >Writing Rexx for myself (therefore no local standards to follow) I had
> to
>
> > >set an internal boolean in a few places.
>
> > >So I started it with
>
> > >TRUE = (1=1)
>
> > >FALSE = \TRUE
>
> > >
>
> > Now you have them; how are they useful?  (Examples?)
>
> >
>
> > >That's partly because I couldn't find doc on Rexx standards (no WWW yet)
>
> > >and I didn't like to assume that 1 and 0 were always valid :-)
>
> >
>
> >
>
>
>
> --
>
> For IBM-MAIN subscribe / signoff / archive access instructions,
>
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>
> --
Scott Ford
IDMWORKS
z/OS Development

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


Re: REXX true/false (was Constant Identifiers)

2020-09-06 Thread Rupert Reynolds
To expand, I had some code monitoring input data as it arrived, waiting for
a fault condition that was in several parts, order unknown.

So I used a few Rexx variables as Booleans, as they made the conditional
code shorter and clearer.

But someone will reuse my code another day (perhaps me), and without the
WWW or access to the proper Rexx docs, can I rely on '1' and '0' always
being equivalent to the Boolean true and false, in every version of every
interpreter and perhaps compilers as well?

This was not like (say) PL/1, in which a bit(1) with the value '1'b had a
precise meaning for Boolean logic, stated in a book already sat on my desk
:-)

Using TRUE and FALSE like constants from the top made it clear to anyone
viewing it, and fairly easy to find and change in the code, if necessary.

It worked, BTW. As I remember things, it found the bug before my coffee mug
was empty, but a few days later they cancelled the software licence over a
different, bigger bug. Ho-hum :-)

Rupert

On Sat., Sep. 5, 2020, 23:56 Paul Gilmartin, <
000433f07816-dmarc-requ...@listserv.ua.edu> wrote:

> On Sat, 5 Sep 2020 23:36:37 +0100, Rupert Reynolds wrote:
>
> >Writing Rexx for myself (therefore no local standards to follow) I had to
> >set an internal boolean in a few places.
> >So I started it with
> >TRUE = (1=1)
> >FALSE = \TRUE
> >
> Now you have them; how are they useful?  (Examples?)
>
> >That's partly because I couldn't find doc on Rexx standards (no WWW yet)
> >and I didn't like to assume that 1 and 0 were always valid :-)
>
>

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


Re: REXX true/false (was Constant Identifiers)

2020-09-05 Thread Robin Vowels

On 2020-09-06 11:50, Seymour J Metz wrote:

Eschew obfuscation. Either just use 0 and one, or write
false=0;true=1. Similarly, for PL/I either just use '0'b and '1'b or
write false='0'b;true='1'b;.


VALUE is a good alternative also.

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


Re: REXX true/false (was Constant Identifiers)

2020-09-05 Thread Seymour J Metz
Eschew obfuscation. Either just use 0 and one, or write false=0;true=1. 
Similarly, for PL/I either just use '0'b and '1'b or write 
false='0'b;true='1'b;.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3



From: IBM Mainframe Discussion List  on behalf of Bob 
Bridges 
Sent: Saturday, September 5, 2020 4:09 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: REXX true/false (was Constant Identifiers)

 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, robhbrid...@gmail.com, 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:IBM-MAIN@LISTSERV.UA.EDU] 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 lists...@listserv.ua.edu with the message: INFO IBM-MAIN

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


Re: REXX true/false (was Constant Identifiers)

2020-09-05 Thread Paul Gilmartin
On Sat, 5 Sep 2020 23:36:37 +0100, Rupert Reynolds wrote:

>Writing Rexx for myself (therefore no local standards to follow) I had to
>set an internal boolean in a few places.
>So I started it with
>TRUE = (1=1)
>FALSE = \TRUE
>
Now you have them; how are they useful?  (Examples?)

>That's partly because I couldn't find doc on Rexx standards (no WWW yet)
>and I didn't like to assume that 1 and 0 were always valid :-)
>
https://webstore.ansi.org/standards/incits/ansiincits2741996r2007
$60.00

-- gil

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


Re: REXX true/false (was Constant Identifiers)

2020-09-05 Thread Rupert Reynolds
Writing Rexx for myself (therefore no local standards to follow) I had to
set an internal boolean in a few places.
So I started it with
TRUE = (1=1)
FALSE = \TRUE

That's partly because I couldn't find doc on Rexx standards (no WWW yet)
and I didn't like to assume that 1 and 0 were always valid :-)

Roo

On Sat., Sep. 5, 2020, 22:48 Paul Gilmartin, <
000433f07816-dmarc-requ...@listserv.ua.edu> wrote:

> On Sat, 5 Sep 2020 16:09:32 -0400, Bob Bridges wrote:
> >
> >  str=word('true false',(0-fx)+2)
> >
> >...where fx is Boolean.
> >
> My use of COPIES() was to save 2 lines of code while knowing that
> the function call/return overhead is large and IF would perform better.
>
> >  if fx then str='true'; else str=true
> >
> ???  So if fx is 1 this sets str to "true"; if fx is 0 this sets str to
> "TRUE"?
>
> But I'd rather do:
> parse value 0 1 with false true.
> Or perhaps mischievously:
> parse value (2+2=5) (2+2=4) with false true .
>
> ... and have useful(?) constant identifiers.  But I can think of
> few places other than function arguments where using Boolean
> constant identifiers improves either performance or legibility.
>
>
> On Sat, 5 Sep 2020 16:18:47 -0400, Bob Bridges wrote:
> >
> >When you care about efficiency, I'd think this would be better:
> >
> >  const=4/3*3.14159E0 /* in the initialization */
> >  volume=const*radius**3 /* inside the loop */
> >
> I leave it to the compiler to perform that sort of constant
> folding.  Most of them do.  Same for reordering operands.
> A programmer computing volumes in several places might
> declare a function (which the compiler should expand inline.)
>
>
> On Sat, 5 Sep 2020 16:21:51 -0400, Bob Bridges wrote:
> >
> >Going back to the beginning, Gil:  SQRT(X**TWO+Y**TWO) looks like
> ~exactly~ the sort of thing that oughta be made a constant rather than
> being coded more than once.  That is, if X, Y and TWO all constants
> themselves; and if they are not then this isn't an example of what you're
> talking about.  Did you accidentally reverse your meaning?  Or what am I
> missing?
> >
> No.  I was assuming that X and Y are variables, perhaps function
> arguments and playing off the Lang. Ref's assertion (almost surely
> wrong, but I can't test it) that any constant (such as 2) occurring
> more than once *must* be declared and referenced as an identifier.
>
> >---
> >/* Anarchy might be great, if only it could be enforced.  -Joseph Sobran,
> 2001-03-27 */
> >
> A couple decades ago I saw signs spray-painted on pavements and
> walls touting the Boulder Anarchist Party.  I thought that Anarchists
> shouldn't have political parties.  But how could that be enforced?
>
> -- gil
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

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


Re: REXX true/false (was Constant Identifiers)

2020-09-05 Thread Paul Gilmartin
On Sat, 5 Sep 2020 16:09:32 -0400, Bob Bridges wrote:
>
>  str=word('true false',(0-fx)+2)
>
>...where fx is Boolean.  
> 
My use of COPIES() was to save 2 lines of code while knowing that
the function call/return overhead is large and IF would perform better.

>  if fx then str='true'; else str=true
>
???  So if fx is 1 this sets str to "true"; if fx is 0 this sets str to "TRUE"?

But I'd rather do:
parse value 0 1 with false true.
Or perhaps mischievously:
parse value (2+2=5) (2+2=4) with false true .

... and have useful(?) constant identifiers.  But I can think of
few places other than function arguments where using Boolean
constant identifiers improves either performance or legibility.


On Sat, 5 Sep 2020 16:18:47 -0400, Bob Bridges wrote:
>
>When you care about efficiency, I'd think this would be better:
>
>  const=4/3*3.14159E0 /* in the initialization */
>  volume=const*radius**3 /* inside the loop */
>
I leave it to the compiler to perform that sort of constant
folding.  Most of them do.  Same for reordering operands.
A programmer computing volumes in several places might
declare a function (which the compiler should expand inline.)


On Sat, 5 Sep 2020 16:21:51 -0400, Bob Bridges wrote:
>
>Going back to the beginning, Gil:  SQRT(X**TWO+Y**TWO) looks like ~exactly~ 
>the sort of thing that oughta be made a constant rather than being coded more 
>than once.  That is, if X, Y and TWO all constants themselves; and if they are 
>not then this isn't an example of what you're talking about.  Did you 
>accidentally reverse your meaning?  Or what am I missing?
> 
No.  I was assuming that X and Y are variables, perhaps function
arguments and playing off the Lang. Ref's assertion (almost surely
wrong, but I can't test it) that any constant (such as 2) occurring
more than once *must* be declared and referenced as an identifier.

>---
>/* Anarchy might be great, if only it could be enforced.  -Joseph Sobran, 
>2001-03-27 */
>
A couple decades ago I saw signs spray-painted on pavements and
walls touting the Boulder Anarchist Party.  I thought that Anarchists
shouldn't have political parties.  But how could that be enforced?

-- gil

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


Re: REXX true/false (was Constant Identifiers)

2020-09-05 Thread Jeremy Nicoll
On Sat, 5 Sep 2020, at 21:09, Bob Bridges wrote:
>  I've never done that, but I have done something like it:
> 
>   str=word('true false',(0-fx)+2)

Why   (0-fx)+2when  2-fxis simpler?

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

Not really.  That might as well have been

   str =  "true"

but somewhat pointless.  (Sorry.)

-- 
Jeremy Nicoll - my opinions are my own.

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