RE: match() (not short, he he)
- Posted by gertie at visionsix.com May 27, 2003
- 401 views
On 27 May 2003, at 11:16, Al Getz wrote: > > > Hello again Kat, > > > >Kat wrote: > >match("b",{{"a","b","c"}}) -- 0 > >There you simply have it nested too deeply. And you know that. > > > > Yes i know that and you know that, but the language doesnt. It doesn't??? When i run it, it returns zero! And it should return zero! If your's doesn't, you better contact Rob, your interpreter has a bug somewhere! > It doesnt matter how deeply you nest something, the > language has to have a way of conveying the result to the > program that makes sense for ALL possible cases, not just > some... That doesn't mean it should give errors! > i=match("b","abc"}}) -- ret 2 I say no. The b in "abc" looks like an atom to me, and you told match to look for a "b", which is a sequence. > i=match("b",{"a","b","c"}) --ret 2 Yes. > i=match("b",{{"a","b","c"}}) --ret 2 > i=match("b",{{{"a","b","c"}}}) --ret 2 No, and no. > You really have to stick your result into some code > to find out what really happens next, once you > think you have determined a better return result. Doesn't matter what i code, Rob isn't going to put it into the official Euphoria, is he? Kat