On Tue, 14 Apr 1998 10:40:54 -0400 (EDT), "Fred L. Drake" <[EMAIL PROTECTED]>
wrote:
> > 3. This is how I implemented it in l2h-ng. 8-)
>
> Cool! Do you consider l2h-ng suitable for large conversion projects
> that couldn't easily switch back, or should I wait?
The status of l2h-ng is this: Sometime in 1996 I decided that there was
just too much overhead in l2h and that the conversion should be more TeX-
like. The input should be parsed directly without texexpand and without
any preprocessing. This would even make it possible to do things like
redefining catcodes. I started rewriting l2h and called it l2h-ng (next
generation). However, it turned out that I had to almost completely
rewrite l2h and thus it took me much longer than expected. In the meantime,
development of the "regular" l2h progressed and l2h-ng was based on an
older version. When it came out in spring 97, it was missing several
features and quite a few style-files hadn't been rewritten. I haven't
done anything on it since, but some ideas from l2h-ng have gone into l2h.
Unless someone else expends efforts into bringing l2h-ng up-to-date it will
probably never stand on its own.
> I noticed that you are getting $_ passed in, and then performing a
> destructive operation on it; should $_ be removed from the interface
> to these functions? That seems desirable if you want to hide a
> line-based input system behind the whole thing.
You are probably right. In l2h-ng I had passed in an argument because it
was possible that one would want to read an argument from a piece of text
that had previously been read. For example, a `$' invokes a read up to the
next `$' and a switch into math mode. In math mode, commands are processed
until either there is no more text or until an unknown or unprocessable
command is encountered in which case the whole thing is passed on to the
image-generation routine.
This first argument is passed from subroutine to subroutine and is never
changed by any subroutine except the get_next_* subroutines which either
remove or add text.
> Being able to use a single
> function when implementing either commands or environments would be a
> major boon (due to simplicity of the interface), but would have to be
> supported in the dispatcher. Is this done in l2h-ng, and are there
> plans for including this feature in l2h 98.x?
This was one of the major features of l2h-ng and it would take a big
boatload of work to include it in l2h. You see, one of the biggest
problems of l2h is that everything is processed "inside-out". That is,
the innermost environment is processed first. In l2h-ng processing occurs
in standard TeX order. This is done by treating environments exactly like
any other command: There exists a do_cmd_begin and d_cmd_end routine. The
do_cmd_begin routine checks its argument, opens a new level of nesting
and calls the appropriate do_env_begin_* routine. do_cmd_end also checks
its arguments, makes sure the nesting is right, closes the nesting level
and calls do_env_end_*. The major plus: you get proper scoping of
declarations, definitions, etc. You also get the same behaviour as in
LaTeX. For example, an environment can be opened in one file and closed in
another. Major minus: You have to make exactly sure that you handle all the
nesting levels right. Otherwise things can go very bad.
Marcus