I was discussing recent developments with a new convert to Pop-11
at Birmingham, Riccardo Poli, who uses it for teaching and research
(even on evolutionary algorithms).
When I mentioned that I had found a way to make the matcher work with
lvars by using lib readpattern and the syntax ![ ..... ] for patterns,
he commented that in effect that violated the spirit of lvars because
the matcher is then a procedure defined elsewhere that has access to the
lvars variables, which is not supposed to be possible with lexical
scoping!
This is a point that had never occurred to me nor, it seems, to others
who had wanted the matcher to be made to work with lvars.
His argument, therefore (if I understood him), was that calls to the
matcher should always be "inline" code, so that it was impossible to
pass the matcher a pattern created elsewhere, or to use the matcher, or
a procedure using the matcher, as a procedure argument to another
procedure in which patterns are created.
In fact, that's exactly what LIB FMATCHES does: it defines fmatches as a
syntactic operator, not a procedure. I had always claimed that that was
inadequate, because it made it impossible to define things like present,
remove, allpresent, and other procedures that can take a pattern as
input.
Riccardo's argument is that on the contrary, fmatches is right, and
moreover the other things that operate on patterns should ALL be syntax
words that occur "inline" with the patterns they act on, e.g. all
analogues of present, lookup, remove, allpresent, etc. would have to be
introduced as new syntax words, as forevery and foreach are already.
I had previously thought about generalising fmatches in that direction
but decided that being able to use the matcher as an ordinary procedure
was too important to give up.
What do others think?
Aaron
PS
I've just realised that I could change my definition of LIB READPATTERN
so that pattern variables would not need to be declared explicitly
at all. They would simply automatically be declared as dlvars, (or
maybe lvars). What do others think?
--
Aaron Sloman, ( http://www.cs.bham.ac.uk/~axs )
School of Computer Science, The University of Birmingham, B15 2TT, England
EMAIL A.Sloman@cs.bham.ac.uk
Phone: +44-121-414-4775 (Sec 3711) Fax: +44-121-414-4281
|