lout-users
[Top][All Lists]
Advanced

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

Re: Re: Can anyone save my sanity -- help me to understand filtering?


From: Valeriy E. Ushakov
Subject: Re: Re: Can anyone save my sanity -- help me to understand filtering?
Date: Sat, 7 Jul 2001 02:33:15 +0400
User-agent: Mutt/1.3.3i

On Thu, Jul 05, 2001 at 22:50:43 +0400, Graham Douglas wrote:

> def @Filter {Lua @FilterIn > @FilterOut}

One point, on Win98 IO redirection is sucky, so you'd better arrange
for you program to take @FilterOut as an argument and open it for
ouptut from the program itself.


> @Lua {
> dofile("c:\\lua\\hello.lua")
> }
> 
> then Lout creates a temporary file 
> (expands @FilterIn) called louti1
> which then has the string 
> 
> dofile("c:\\lua\\hello.lua")
> 
> written into it. Am I right so far?

Yep.


> Now, Lua is called with the CONTENTS of this temporary file (louti1)
> as its argument so Lua sees
> 
> Lua dofile("c:\\lua\\hello.lua")

NO!  Lua will be called with the NAME of this file as its argument.

> and (with Lua) the output is written to stdout 
> by default which is then piped (correct term?)

"redirected"


> Well, almost. The bit I still have to crack is how to get Lout to do
> an @IncludeGraphic from a situation where Lua outputs EPS code.

Well, simple :).  See my example in the previous email.

You make your Lua script to write the file somewhere and the you make
the script to output the NAME of that EPS file.  You then just
@IncludeGraphic it.

    def @Lua
      right x
    {
      def @Filter {Lua @FilterIn > @FilterOut}
      @IncludeGraphics { x }
    }

Then make c:\lua\hello.lua to write EPS file hello.eps and make the
hello.lua to PRINT to its stdout the name of that EPS file:
"hello.eps".   Lout will execute the script (the script will create
hello.eps) then lout will read the output from the script (the
*string* "hello.eps) and the it will do

    @IncludeGraphics { hello.eps }

Voila.

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]