On Mon, 4 Aug 2003, Jonathan L Cunningham wrote:
>
> (not sure how reliable the mailing list/newsgroup gateway is at
> the moment, so cc-ed to steve)
If you email to pop-forum from an address not in the list, it
hangs untill I approve it.
I am in Sweden for a project-planning meeting, but as the hotel
offered a high speed internet connection, and I've recently learnt
how easy it is to make my linux-only laptop connect via DHCP,
and I had to fetch a file from Birmingham anyway, I could not
resist.
> >>No syntax colorizing has to be the top one,
> >
> >OK - not the "vi" I grew up with but one of the modern variants. I'm
> >not mad keen on syntax coloring myself, as it happens, but it would be
> >a nice generalization to make internally to Ved.
>
> As it happens, last time I tried to start using ved again, syntax
> colouring was the thing I missed first. (E.g. if it's red, it's a
> typo.)
One problem with the very notion of syntax colouring in pop11 is that
it's a language with no syntax.
To be more precise: the use of macros and syntax words allow almost any
syntax to be accepted by the compiler (including, of course, the syntax
of objectclass, or common lisp, of prolog, of PML, and, modestly,
poprulebase). It's even more extendable than Common Lisp, which only has
macros.
That means that hoping for an editor to do syntax checking is hoping for
the moon, except for toy programs.
Of course there are things like
ENTER define
ENTER while
etc. which insert a syntax form that you can edit.
That collection can be extended indefinitely, e.g.
ENTER objectclass
ENTER mixing
ENTER instance
But I accept that something like syntax colouring could be useful
for novices.
Here is a trivial way to do it which will work just as well for
colour-blind people as for those with normal sight, and just as well no
inverse video as normal video:
(a) define upper-case synonyms for all the main syntax words, e.g.
IF THEN ELSE DEFINE UNLESS FOR BY FROM etc. and all the closing
brackets.
(b) in a .p file made the space character in Ved look at the last
text item, and if it is an alphabetic syntax word capitalise it.
This would be a few minutes work for an expert Ved programmer and would
not have any problems about making files uncompilable, since the
code with upper case syntax words would now be Legal pop-11 for users
of the system.
A utility for decapitating all the syntax words could be provided.
The only problem that leaves is detecting whether you are in a list, or
vector expression, or string, or quoted word, and in that case deciding
whether to capitalise or not.
It's impossible to tell if you are in a string expression without going
all the way back to the beginning of the file!
Maybe the number of unescaped preceding string quotes associated with a
line of the buffer could be cached. It would have to be recomputed
whenever an un-escaped string quote is inserted or deleted.
Aaron
|