Date: Wed, 19 Nov 1997 16:20:01 -0800
Reply-To: REXX Programming discussion list <REXXLIST@UGA.CC.UGA.EDU>
Sender: REXX Programming discussion list <REXXLIST@UGA.CC.UGA.EDU>
From: "Shmuel (Seymour J.) Metz" <nospam@GSG.EDS.COM>
Organization: EDS MS
Subject: Re: Why REXX is not my favorite scripting language (was Re:
regular expression matching)
Content-Type: text/plain; charset=us-ascii
Hugues Ferland wrote:
> Could you explain "backtracking"...
Somewhat simplig\fied, backtracking is a concept that applies to pattern
matching algorith. Lets say that A, B and C are definitions of patterns,
and that I am attempting to match a string against A B C. Naively I just
match A against the string, match B against the substring where A left
off and match C against the rest. The problem is that any of the
patterns may match more than one substring, and that the wrong choice
may prevent a later pattern form matching, e.g., if I want to match the
string 0213ABCDEFG against DIGITS LETTERS 'D', I must let DIGITS match
the longest possible substring and let LETTERS match a three character
substring. The way that this is handled is to allow the each pattern to
match the shortest possible substring, but when a subsequent pattern
fails, backtrack and attempt to allow a previous pattern to match a
longer substring.
There is an extensive literature on the various ways to deal with
backtracking.
> I think that argument parsing in the language, instead of relying on the
> OS/2 provide much greater flexibility.... Of course, sometimes (most of
> the time) we would like to have to job done for us. ;)
Well, I would like the job done for me upon explicit request, but I
don't want the job done for me when it's inappropriate. I want the
ability to control how the command line will be parsed without having to
handle all of the details myself.
> > I need to be able to
> > capture the output of the command for processing within the script. In
> > another article Ian Collier indicated that this problem has been
> > addressed by the ANSI standard. Now I just need a REXX implementation
> > that follows the standard ...
>
> Under OS/2, use the RXQUEUE command like that:
It does what he wants, but it's not ANSI.
--
Shmuel (Seymour J.) Metz
Senior Software SE
The values in from and reply-to are for the benefit of spammers:
reply to domain eds.com, user msustys1.smetz or to domain gsg.eds.com,
user smetz. Do not reply to spamtrap@library.lspace.org