Meta-language for mxTextTools
Tony J. Ibbs (Tibs)
tony at lsl.co.uk
Fri Jul 16 07:12:38 EDT 1999
M.-A. Lemburg wrote:
>Well, it's just that "def" state exactly what you are doing
>when you define a table. "is" is only used in comaprisons in
>Python, so the analogy doesn't go too far.
Point taken, although the use of "is" allows one the nice side-effect that:
comment is:
'comment' = Table is:
Is '#'
AllNotIn '\n\r' F:MatchOk
falls out neatly, with the "is:" taking the place of the table name
argument. It somehow feels less neat to me if one has to use "def" in there
somehow (before or after the "Table"?). I don't pretend to have designed
that in - it was a happy coincidence.
>You might even consider using "table" to start the section.
>This wouldn't conflict with functions/methods in Python and
>still express what you are aiming at.
Hmm. Same problems as above.
Unfortunately, whilst it is hacky, I *like* the fact that Python mode, etc.,
recognise "is" as a keyword and highlight it. Still, it's obviously a bigger
itch than I'd expected, so I'll reflect on it carefully when I start
implementation.
>There is a small difference in semantics between "previous" and
>"back": you are using "previous" to move the instruction pointer
>in the table, while "back" moves the engine's current position
>in the text. So having to different synonyms may be a good idea
>(the wording is secondary, IMHO).
Whilst I don't particularly care if the same word is used in different
contexts, I think I tend to agree that it might be confusing (and perhaps
smells a little Perl-ish). I agree that the wording is secondary. Given that
we only *need* one word (for skip -1, since other skips are more complex or
rarer), I guess "back" is probably the one to choose for now (perhaps what I
really want is to be able to say "Unread" instead of "Skip" when one is
going backwards - does that make any form of sense as extra syntactic
sugar?).
>...my major gripe with the tables: you constantly
>have to adjust offsets whenever you insert things. A meta language
>ought to take care of this by introducing jump targets.
For some strange reason I've always been bad at integer offsets (so handle
things like "last-but-two" very badly). Thus my *first* thought on looking
at mxTextTools was a wish to get rid of them. The problem of *editing* the
tables and having to adjust offsets is obviously such a horrible prospect it
hadn't even occurred to me, but yes, that is also a major advantage of using
labels.
I *really* will have to implement this when I get back from holiday now (oh,
if only someone would buy me a portable PC!)
Tibs
--
Tony J Ibbs (Tibs) http://www.tibsnjoan.demon.co.uk/
Feet first with 5 wheels...
My views! Mine! Mine! (Unless Laser-Scan ask nicely to borrow them.)
More information about the Python-list
mailing list