home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.rexx
- Path: sparky!uunet!mcsun!sunic!sejnet.sunet.se!eric
- From: eric@sejnet.sunet.se (Eric Thomas)
- Subject: Re: Re: Blanks, REXX, and portability...
- Message-ID: <1992Sep1.165241.1@sejnet.sunet.se>
- Lines: 76
- Sender: news@sunic.sunet.se
- Reply-To: ERIC@SEARN.SUNET.SE
- Organization: SUNET, Stockholm, Sweden
- References: <9208310858.AA28086@SERVER.uwindsor.ca>
- Date: Tue, 1 Sep 1992 16:52:41 GMT
-
- In article <9208310858.AA28086@SERVER.uwindsor.ca>, Scott Ophof <ophof@SERVER.UWINDSOR.CA> writes:
- > Question:
- > How much breakage would occur if the double quotes retained that
- > meaning, but the single quotes were to allow interpretation to some
- > extent? In other words:
- > Parse var data a b . " A("
- > means "ASCII '20'X followed by 'A('".
- > But:
- > Parse var data a b . ' A('
- > means "one whitespace followed by 'A('".
-
- A lot of breakage would occur, I know people who use double quotes all the time
- (because they are used to C) while I always use single quotes, except that I
- might use double quotes for a message text which contains a single quote, and I
- also use double quotes for INTERPRET.
-
- Regardless of compatibility with existing programs and of the fact that it
- would require major reworks of the internals of the interpreters, it is simply
- impossible to do without violating one of the cornerstones of REXX (the single
- data type) and turning the language into a factory. Consider:
-
- Pos(" A(",text) -> literal
- Pos(' A(',text) -> interpreted
- Pos("I'm a" 'double quote (")',text) -> ???
- Pos(Pattern(a,b),text) -> ???
- a = " A("; Pos(a, text) -> ???
-
- The list is endless. REXX has no data type, so the interpreter cannot know what
- kind of literal type an argument has.
-
- >>It is a fact that most non-EBCDIC systems use tabs in source code, and won't
- >>change their minds just because of REXX. So REXX interpreters running on ASCII
- >>systems should accept tabs as valid white space delimiters in source code.
- >
- > What happens when John copies this source program to a system that
- > does NOT recognize tab as whitespace, and gives it to Jack to test,
- > without telling him it comes from an ASCII system?
-
- Jack does XEDIT FOO REXX, sets tabs to his liking, EXPAND * and FILE. That's
- one answer. Another answer is that it doesn't matter, since John's unix program
- is extremely unlikely to run under VM or MVS anyway. I think I own 2 programs
- which will work on any system, one makes calculations on dates and the other
- parses mail headers. No wait, the second one requires Pull/Queue, so it won't
- work everywhere.
-
- >>A tab in a quoted string is a tab, not a blank, just like in C and other unix
- >>languages. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- > ^^^^^^^^^
- > Are you *100%* *SURE* of this?
-
- main()
- {
- char *s;
- s = " "; /* tab */
- printf("%X\n", *s);
- return(1);
- }
-
- Prints 9. Compiled with GCC, not a DEC compiler you could accuse of being
- un-unixish. The author of GCC refers to VMS as "Vomit Making System" and can
- hardly be accused of admiring DEC conventions and standards.
-
- > I claim that with a nice set of functions translating the relevant
- > system commands to a standardised REXX I/O, portability *is* *very*
- > definitely relevant.
-
- Ok Scott, say I give you a unix playstation with a copy of the source code for
- LISTSERV (25-30k lines of REXX), and pay you by the hour to make it work under
- unix. How much money will I save if I give you a REXX interpreter to make the
- conversion easier?
-
- The answer is I'll lose money, because it will take you about 1-2 months to
- realize it is much faster to rewrite everything in C than to try to reuse the
- REXX code with the interpreter.
-
- Eric
-