lout-users
[Top][All Lists]
Advanced

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

Re: Lout beginner's queries


From: Valeriy E. Ushakov
Subject: Re: Lout beginner's queries
Date: Thu, 30 Jul 1998 19:17:09 +0400

On Thu, Jul 30, 1998 at 02:45:14PM +0100, address@hidden wrote:

> @RightDisplay lines @Break {
> 9 Bankfield
> Westhoughton
> Bolton   BL5 2QG
> Tel: 01942 817892
> @I address@hidden
> @FullWidthRule
> @Date
> }
> 
> Flushed with success, I decided to define @MyAddress as a name to use for
> the above block using the following where the ... stands for the working
> block. That's when the problems started.
> 
> def @MyAddress {
> ...
> }

You will also need to bring @RightDisplay &co in scope:

    import @DocumentLayout
    def @MyAddress { ... }


> I put it where it was going to be used;

Definitions are not allowed there as you are inside a body (right)
parameter to the @Text symbol.


> I put it near the start of the file (initially at the very beginning
> of the file,

Definitions are allowed here, but at that time none of the symbols you
refer to (@RightDisplay etc) are defined.


> then after address@hidden { doc }',

Definitions are not allowed after you have included the setup file as
technically, after you have included the setup the rest of your
document is inside the right argument of the @Open symbol (@Use, in
fact).


> I also put it in file `mydefs' as suggested in the user manual.

Yes, `mydefs' (though I prefer `mydefs.lt') is where you put your own
definitions.


> Only the last gave no errors but it put the address in a different
> place on the paper output.

Do you have a @PP or @LP after you address, i.e.

     @Text @Begin
     @MyAddress

     @LP
     Hi there!

You must have a vertical concatenation after the address.
@RightDisplay macro takes care about it, but when you hide it inside
the definition and just use

    @MyAddress
    Hi there!

Lout reads tree objects @MyAdress, "Hi", "there!" separared by spaces,
so it makes a pragraph of them - that's why you see your address in a
different place.  This is a side effect of the "where one object can
go, any object can go" rule and lout doesn't really care if this is a
@MyAddress or a word "Hi" or a complex FSM diagram.

You can also check for more info:
    http://www.ptc.spbu.ru/mail-archives/lout/0160.html

[Note, the hypermail is really bad at threading, so if you will look
 for the context, use date index.]


> It leaves me feeling that there are some places where definitions
> can occur and some where they cannot but so far I have been unable
> to find definitive information on this.

Basicly, definitions can occur at the top level before anything that
lout considers to be an expression (body "text").  Definitions can
also occur nested, in which case all the nested definitions again must
precede the expression that constitutes the body of the enclosing
definition.

When lout starts to parse the expression it doesn't look for
definitions any more, so when it encounters `def @Foo', it treats
"def" as a simple word than it sees @Foo and it doesn't know that
symbol so it complains.  E.g. given

    def @Bar { he he }
    def @Foo { Foo def @Bar { bar }}

@Foo => Foo def he he bar


In practice, this means that all top-level definitions must be before
the first invocation of @Use in the setup file.  Standard setup files
include `mydefs' just before the first @Use invocation.


> 1. Where do I put the definition (preferably in a separate file) and
>    what am I doing wrong at present?

I hope I have already answered this one.  In short, `mydefs' or
`mydefs.lt' whichever you like.  Lout tries to add `.lt' automatically
when it looks for files.


> 3. Is there more documentation than the supplied user, expert and
>    design papers that may help when errors occur?

No.  OTOH, the supplied documentation, though quite terse sometimes,
is of very high quality.  But Lout is so different from *roff and TeX,
that this difference is sometimes a "barrier to enter" the Lout world.
Once you are familiar with the functional style of Lout, the expert
guide is almost all that you need to write Lout code.


> 4. Is version 3.10 the latest?

The latest version is 3.12.


> Any help would be much appreciated.

You are welcome.

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]