Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PARSE VERSION result is non-standard #78

Closed
RossPatterson opened this issue Sep 4, 2024 · 4 comments
Closed

PARSE VERSION result is non-standard #78

RossPatterson opened this issue Sep 4, 2024 · 4 comments
Assignees

Comments

@RossPatterson
Copy link
Collaborator

RossPatterson commented Sep 4, 2024

The PARSE VERSION instruction is defined by TRL2 to parse a 3-word phrase:

Information describing the language level and the date of the language processor is parsed. This consists of five words delimited by blanks.

  1. A word describing the language. The first four letters will be the characters "REXX", and the remainder may be used to identify a particular implementation or language processor. This word may not include any periods.
  2. The language level description. For example, "4. 00". Numbers smaller than this may be assumed to indicate a subset of the language defined here.
  3. Three tokens describing the language processor release date in the same format as the default for the DATE() function (see page 92).
    For example, "16 Oct 1989".

The ANSI standard agrees:

It shall have five words. Successive words shall be separated by a blank character. The first four letters of the first word shall be 'REXX'. The second word shall be the four characters '5.00'. The last three words shall be in the format which is the default for the DATE() built-in function.

BREXX parses: CMS bREXX 1.0.1 Jul 5 2022, which is wrong in several ways.

  1. It is 6 words, not 5.
  2. The first word is "CMS", not "REXXsomething".
  3. If we ignore the first word, the language level is "1.0.1", which is not a valid REXX language level (the earliest available outside IBM was 3.20), and is actually the BREXX release number.
  4. The date is in Mmm dd yyyy form, not dd Mmm yyyy.

This should be changed to something like REXXBREXX 3.40 5 Jul 2022, assuming that BREXX is roughly the equivalent of VM/SP 5 and VM/XA CMS's REXX. There are some small things missing from that level (e.g., OPTIONS ETMODE), but it's otherwise correct.

@RossPatterson
Copy link
Collaborator Author

How about something like REXX-bREXX-2.1.9-CMS370-x.y.z 3.40 23 Sep 2024? The x.y.z would come from #define CMSVERSION, and the rest would declare that this is based on Vlachoudis's bREXX 2.1.9 for CMS on VM/370. I'm still checking on what Rexx version corresponds with the CMS370 BREXX capabilities, and 3.40 may not be exactly rigjt.

I still haven't figured out how to rearrange the build date parts, working entirely in the C preprocessor. It may not be possible. But the VERSIONSTR definition is only used in one place, where interpre.c processes the LoadOpt operation for PARSE VERSION. So maybe instead I'll rearrange the build date at runtime there.

@RossPatterson RossPatterson self-assigned this Sep 24, 2024
@RossPatterson RossPatterson added the in-progress Being worked on label Sep 24, 2024
@RossPatterson
Copy link
Collaborator Author

This is fixed in bRexx 1.1.0 beta 01. PARSE VERSION now returns "REXX-bREXX-2.1.9-CMS370-1.1.0 3.40 dd Mmm yyyy". I'm doing further research on whether 3.40 is the correct Rexx level, but it's close, so that's what I'm using for now.

@RossPatterson RossPatterson added resolved Resolved - will be included in next release and removed in-progress Being worked on labels Nov 3, 2024
@RossPatterson
Copy link
Collaborator Author

Closing

@RossPatterson RossPatterson added fixed in next release and removed resolved Resolved - will be included in next release labels Nov 5, 2024
@RossPatterson
Copy link
Collaborator Author

RossPatterson commented Nov 8, 2024

After further research, especially The Rexx Handbook (Goldberg and Smith, eds.), it's clear that bREXX is at least at Rexx level 3.40. It doesn't have the OPTIONS instruction, but there are no options that it would honor if it did, so it's a moot point. It also doesn't have DIAG() and DIAGRC(), but it turns out they should be provided by CMS in am RXSYSFN function package. The only real omission is DATE(BASEDATE) (see Issue #87).

bREXX goes well beyond 3.40. It has stream I/O, for example. But I think it's better to set the level such that everything defined is implemented, rather than claim to be "almost 4.00".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant