texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Texmacs-dev] (Important for scheme hackers) TeXmacs tags become more st


From: Joris van der Hoeven
Subject: [Texmacs-dev] (Important for scheme hackers) TeXmacs tags become more stable
Date: Wed, 12 Nov 2003 13:33:40 +0100 (CET)

Hi,

I more or less completed a major reorganization whose object is to

  1) Replace all EXPAND/VAR_EXPAND/HIDE_EXPAND/APPLY tags by
     built-in primitives or COMPOUND tags. The second ones are
     only used if the name of the COMPOUND tag is not a string.
  2) A consequence of 1) is that the scheme representation now
     perfectly matches the intern representation.
  3) Drd properties can be associated to tags and exploited by
     the editor.

So if you wrote some non-trivial scheme code for TeXmacs,
then it is possible that you have to update some parts of it,
especially if you used the APPLY tag. Fortunately, things should
remain stable from now on though.

Let me explain 3) a bit. TeXmacs DRD's (Data Relation Definitions)
are meant to become an enrichment of usual DTD's with additional
logical structure. Whereas a usual DTD would mainly formalize which
documents are correct (i.e. arities of tags and maybe constraints
of which tags should be or cannot be used inside other tags),
the DRD also contains information like "the user is allowed to
place the cursor inside the n-th child of this tag" or "this tag
is a block structure".

Because of the macro facility of TeXmacs, it should also be noticed
that DTD's and DRD's have to be extremely flexible, since they
basically change each time when the user adds a new macro.
So TeXmacs has to provide a mechanism which both

  1) Allows you to specify a very precise DTD/DRD which cannot
     be altered by the user (example: certain forms in industry).
  2) Allows the DRD to be updated in a user friendly way when
     you define new macros or style files.

The solution I found for this problem is the following:
TeXmacs style files will both specify style and DRD properties.
(Consequence: there will be no clear distinction between style files
and DRD files in TeXmacs. A style file may only contain formatting
instructions, or DRD instructions, or both.)

Moreover, TeXmacs provides a high-quality and on-the-fly heuristic
algorithm in order to automatically determine missing DRD properties
merely from the definition of a macro. For example, if you write
a macro like

        (assign "hi" (macro "name" (concat "Hi " (arg "name"))))

then TeXmacs will automatically recognize that "hi" has arity 1
and that its only child is accessible. Nevertheless, if the user
explicitly sets the DRD properties of a tag in a style file,
then this will disable the heuristic determination of this property.

Little advantage is taken out of the DRD information right now,
but in future versions, we plan to further enrich it and
implement more reliable cursor movement, block structures,
structured editing facilities, etc.

Have fun, Joris





reply via email to

[Prev in Thread] Current Thread [Next in Thread]