Path: utzoo!mnetor!uunet!lll-winken!lll-tis!mordor!sri-spam!ames!pasteur!ucbvax!CITHEX.CALTECH.EDU!carl From: carl@CITHEX.CALTECH.EDU (Carl J Lydick) Newsgroups: comp.os.vms Subject: Re: Puzzles in TPU-land ... Message-ID: <880412093213.71d@CitHex.Caltech.Edu> Date: 12 Apr 88 16:35:50 GMT References: <8804071545.AA04487@scgvaxd.SCG.HAC.COM> Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 22 > This nested pattern example (very similar to the one above) ... > > pat1 := 'foo ' & 'bar'; > pat2 := 'please ' & pat1; > range1 := search(pat2,forward); > > ... finds a match in "would somebody please pass the foo bar?" > ----------------------- > whereas ... > > pat1 := 'jelly'; > pat2 := 'please ' & pat1; > range1 := search(pat2,forward); > > ... finds *NO* match in "would somebody please pass the jelly bar?" > > It doesn't seem to work quite right when pat1 is a single term rather > than two concatenated terms. The problem is that in the second case, pat1 is a string and not a pattern. The presence of the "&" operator in the first example forces tpu to make pat1 a pattern.