home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!comlab.ox.ac.uk!imc
- From: imc@comlab.ox.ac.uk (Ian Collier)
- Newsgroups: comp.lang.rexx
- Subject: Re: Curious Question
- Message-ID: <2420.imc@uk.ac.ox.prg>
- Date: 11 Sep 92 10:48:50 GMT
- References: <Leon_Davidoff.04fe@panam.wimsey.bc.ca>
- Organization: Oxford University Computing Laboratory, UK
- Lines: 34
- X-Local-Date: Friday, 11th September 1992 at 11:48am BST
- Originator: imc@msc2.comlab
-
- In article <Leon_Davidoff.04fe@panam.wimsey.bc.ca>, Leon_Davidoff@panam.wimsey.bc.ca (Leon Davidoff) wrote:
-
- >What I would like to know is why b in Test1 is assigned the value ' y'
- >while in Test2 the value is 'y'.
-
- The reason is because the writer of ARexx (at least until v1.15 - if I
- remember correctly) didn't read a full description of the parse instruction
- closely enough before implementing it (IMHO).
-
- You may know that in:
-
- parse value " alpha beta gamma delta " with a b c d
-
- a, b and c contain no blanks whatsoever, whereas d may (and in fact does in
- this case). Because d is the last name in a list of symbols, it retains all
- the blanks which were not eaten by the preceeding template. ARexx takes
- this to mean that d contains two leading blanks and two trailing blanks.
- However, the truth is that the blank which immediately follows "gamma" was
- used up in order to separate "gamma" from " delta " - and so d should only
- contain one leading blank.
-
- A consequence of this is that in:
-
- parse value "1 2 3" with a b c
-
- ARexx retains the space which precedes the "3", whereas standard Rexx does
- not. There are two fixes to this: (a) [when c might contain multiple words]
- say "c=strip(c)" just after parsing, and (b) [when c must contain at most
- one word] follow the template with a dot, as in:
-
- parse value "1 2 3" with a b c .
-
- Ian Collier
- Ian.Collier@prg.ox.ac.uk | imc@ecs.ox.ac.uk
-