lout-users
[Top][All Lists]
Advanced

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

Re: Changing @Use semantic


From: Valeriy E. Ushakov
Subject: Re: Changing @Use semantic
Date: Mon, 7 Sep 1998 11:44:15 +0400

On Mon, Sep 07, 1998 at 11:18:22AM +1000, Jeff Kingston wrote:

> Uwe proposes allowing @Use within inner scopes as well as at the
> outer level.  This might be reasonable but it seems to be addressing
> a different problem.

Yes, sorry, I digressed into specialization vs. generalization of @Use.


> The observation that the @Include of a package is logically coupled
> with its @Use - you include it and customize it as you go - makes
> a lot of sense.  It's like object-oriented programming really, like
> the creation of a (say) diagram-printing object from a @DiagramPrint
> class.  But again, I don't think it solves the problem.  Suppose you
> could indeed write
> 
>     @IncludeAndUse { @DiagramPrint ... }
> 
> how would that help to reduce the number of setup files?

I thought about something like

    @SysInclude { book }        # document type
    @SysInclude { tables }      # @IncludeAndUse for tab
    @SysInclude { diagrams }    # @IncludeAndUse for diag
    @SysInclude { graphs }      # @IncludeAndUse for graph

kind of \documentclass and \usepackage in LaTeX.


> Incidentally, recent versions of Lout allow parameters to be given
> an import clause.  This may be relevant to Uwe's needs for a local
> @Use.

In the first place, I've thought this generalization might help
producing machine generated Lout code (our initial discussion an year
ago was about implementing DSSSL inherited characteristics).

Import and @Open are the two sides of one coin.  Import clause names
the symbol to import from; @Open provides an invocation to actually
import values from (or use parameterized instances of definitions).

Consider

    export @Foo @Bar
    def @WithFooBar
      named @Foo { foo }
      named @Bar { bar }
    {}
    
    import @WithFooBar def @DoFoo { "@Foo" is @Foo }
    import @WithFooBar def @DoBar { "@Bar" is @Bar }

and in the document:

    @LP  @DoFoo.  @DoBar.
    @LP  { @WithFooBar @Foo {10} @Bar {20} } @Open { @DoFoo.  @DoBar. }

which gives:

          @Foo is foo.  @Bar is bar.
          @Foo is 10.  @Bar is 20.



But if the scope (right parameter of @Open) is long, Lout can run out
of memory for it will read the whole right parameter at once.

    @Chapter
      @Title { ... }
    @Begin
    { @WithFooBar @Foo { ice cream } @Bar { topping } } @Open {
    ... # 30 pages worth of text here
    }
    @End @Chapter


Then, just like toplevel @Use saves Lout from reading the while
document as a right paramter of @Open, local @Use would, similarly,
allow Lout to still read right paramter of a galley paragraph at a
time.

    @Chapter
      @Title { ... }
    @Begin
    @Use { @WithFooBar @Foo { ice cream } @Bar { topping } }
    ... # 30 pages worth of text here
    @End @Chapter


SY, Uwe
-- 
address@hidden                         |       Zu Grunde kommen
http://www.ptc.spbu.ru/~uwe/            |       Ist zu Grunde gehen


reply via email to

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