Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#273 Consider convenience enhancements to ooRexx

Rejected
closed
Rick McGuire
None
5
2012-08-14
2008-04-27
Anonymous
No

Suggested Enhancements to ooRexx

  1. Symbolic notation for AND, OR and NOT operators

This enhancement make the following (case-insensitive) symbols equivalent:

AND     &
OR      |
XOR     &&
NOT     \
  1. CENT character should be allowed in identifiers

IBM mainframe Rexx allows the EBCDIC CENT character in identifiers. There are two representations of CENT in ASCII. For ISO 8859-1 ("Ansi"), the CENT character is at 0xA2, while in code page OEM 437, the CENT character is at 0x9B.

This enhancement allows both versions of CENT (0xA2 and 0x9B) as identifier characters.

  1. Alternative delimiter should be allowed for quoted strings

The ASCII accent character should be allowed as an alternative to ' and " as string delimiters. The accent quote follows the same general rules as the standard Rexx string delimiters. Anywhere the ' and " string delimiters are permitted, the quote delimiter is permitted, and is used in the same general way. This applies to quoted character strings, quoted hex values, and quoted binary values.

A string must be closed on the same line it begins on, and quoted-quotes (a data character which has the same character value as the enclosing quotes) must be doubled. There is no need to double one of the quote characters if it is not the same as the enclosing quote, and it were doubled, two such characters will be produced. Example (all define the same string value):

'hello, it''s me'       --> hello, it's me
"hello, it's me"        --> hello, it's me
`hello, it's me`        --> hello, it's me

However, note what happens when a quote is improperly doubled:

`hello, it''s me`       --> hello, it''s me
  1. Underscore should be allowed in Hex and Binary values

Underscores in hex and binary values should be allowed; the underscores are for readability and do not affect the value. Values may not begin or end with underscores, nor may underscores be adjacent to each other. Examples:

'12_34'X    -- OK
'12__34'X   -- invalid, adjacent underscores
'_1234'X    -- invalid, leading  underscore
'1234_'X    -- invalid, trailing underscore
  1. C-style hex and binary numeric values should be allowed

Standard Rexx does not allow for direct coding of numeric values in hex or binary. Instead, a string value must be supplied to a conversion routine. For example, 'FF'X is a 1-byte string; to make an equivalent numeric value (255), an expression like X2D('FF') or C2D('FF'X) is required.

This enhancement eliminates the need to use such built-in functions, and allows the values to be coded much more simply and directly. For hex values, the value is the usual C notation of 0x or 0X followed by decimal and/or hex digits (upper and/or lower case). Similar to the hex and binary string values noted above, readability underscores are permitted here. For binary values, the prefix is 2x or 2X instead of 0x or 0X; only digits 0 and 1 are allowed, and again, readability underscores are permitted.

The implementation treats the hex or binary value as an unsigned number, and converts it to its decimal equivalent before Rexx sees it. Example:

0xFF            -- same as 255
2x0001_1111     -- same as 31

Because of how the enhancement is implemented, a SAY statement will display the decimal value of the number, not a hex or binary representation of it. Example:

say '0xFF =' 0xFF       --> 0xFF = 255
  1. Suppression of Newline termination for SAY statement output

Standard Rexx always appends a newline (CR/LF, or LF, depending on the host system) after writing the expression string of a SAY statement. This enhancement eliminates the appending of a newline to the expression string for SAY output. Any newline characters that may already exist in the SAY expression string are written as-as. The alternative action is enabled by putting a comma immediately after the SAY keyword. The comma must appear on the same line as SAY; the SAY and the comma may be separated by whitespace but nothing else, including comments, may separate them. Example:

-- standard Rexx SAY statement

say 'one+'
say 'two='
say 'three'

--- output ---

one+
two=
three

-- enhanced Rexx SAY statement

say, 'one+'
say, 'two='
say  'three'        -- note: no comma after last SAY

--- output ---

one+two=three

Discussion

  • Rick McGuire
    Rick McGuire
    2008-08-18

    Logged In: YES
    user_id=1125291
    Originator: NO

    I am rejecting this primarily because you really should open these are separate RFEs, since for tracking purposes, some might be accepted, others rejected, and item #4 is a dup of another RFE for NetRexx compatibility.

     


Anonymous


Cancel   Add attachments