Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

pop11 matcher

3 views
Skip to first unread message

Jonathan L Cunningham

unread,
Jul 16, 2008, 9:50:55 AM7/16/08
to
Does anyone recall the answer to the following question: is the order in
which the pop11 infix 'matches' operator finds matches well-defined in
the language?

Specifically, I know which order it actually works, but is the following
unsafe code?

[c a t a s t r o p h e] -> list;
while list matches [== t ?x ??list] do
x=>
endwhile;

It prints the two letters following a "t" in the list, i.e.
** a
** r

but this depends on the matcher finding the leftmost t in the list. Is
that defined behaviour, or is it an implementation detail? I've skimmed
the documentation, but didn't immediately spot an answer.

Do any libraries rely on code like this? If so, this behaviour should be
defined, if it isn't already.

I'm modifying someone else's code, and I'm wondering whether I should
rewrite part of it (purely on aesthetic grounds, since it is unlikely in
the extreme that any future implementation of the popl1 matcher will
actually behave differently).

If no libraries depend on it, and it is not defined, do people have
views on whether to leave it undefined?

--
Jonathan L Cunningham

0 new messages