[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Changing @Use semantic (Was: @Diag @Use clause)
From: |
Valeriy E. Ushakov |
Subject: |
Changing @Use semantic (Was: @Diag @Use clause) |
Date: |
Mon, 7 Sep 1998 01:50:07 +0400 |
On Sun, Sep 06, 1998 at 10:35:39AM +1000, Jeff Kingston wrote:
> I've been pondering ways to reduce the combinatorial explosion of
> setup files. It occurred to me that @Use could be redefined as a
> no-operation if the symbol inside it was undefined. In that way
> we could have just one setup file for each type of document, but
> still not pay the cost of reading lots of unwanted definitions
> files, just quickly skipping over their @Use clauses.
I would say that it's a kludge. It would be too big a price for too
small a convenience. Any non-trivial document will have it's own
setup file where several parameters are tweaked from defaults and so
user will be able to choose those packages he needs. But, yes, I
completely agree with you that there's a problem with the number of
default setup files, I just think changing @Use semantic in this way
is not the way to go.
The problem is that we have to keep @Include separate from @Use since
after the first @Use no definitions are syntactically permitted, so we
can't group @Include with the corresponding @Use.
It seems that we could make two default setup files per document type,
one bare bones and one kitchen-sink, so that people could make short
documents using one of them as necessary (though all the prologues
will bloat the output in the latter case as you observed). A longer
document will most probably require a custom setup anyway so the setup
can be trimmed to use necessary packages only.
@Use <-> @Open equivalence was, I guess, invented for setup files, but
I think this can be generalized in a useful way, instead of
specializing it in the way you mentioned. We already discussed that
briefly an year ago.
My perspective of @Use is that @Use to @Open is (ideally) like
`define' to `let(rec)' in Scheme. In particular it would be useful to
extend @Use semantic and allow internal invocation of @Use as well,
just like internal definitions in Scheme - but preserving Lout ability
to read galleys piecemeal.
E.g. currently for
@SomeGalley @Begin
....
@End @SomeGalley
Lout will read the right/body parameter of @SomeGaley one paragraph at
a time if @SomeGalley already has a target.
If we need to use @Open:
@SomeGalley @Begin
{ @SomeSymbol } @Open {
....
}
@End @SomeGalley
then Lout will read the right parameter of @Open in one hit and thus
we loose paragraph-at-a-time optimization which is important for large
galleys (since right parameters are usually where bulk of the document
resides).
What I have in mind is:
@SomeGalley @Begin
@Use { @SomeSymbol }
...
@End @SomeGalley
that would be equivalent to the previous example. I.e. to extend the
@Open <-> @Use equivalence in a natural way from the current "to the
end of input" to "to the end of scope" while preserving the above
mentioned optimization for right parameters of galleys.
SY, Uwe
--
address@hidden | Zu Grunde kommen
http://www.ptc.spbu.ru/~uwe/ | Ist zu Grunde gehen
- @Diag @Use clause, Jeff Kingston, 1998/09/05
- Changing @Use semantic (Was: @Diag @Use clause),
Valeriy E. Ushakov <=