|
From: | Graham Douglas |
Subject: | Re: Re: Can anyone save my sanity -- help me to understand filtering? |
Date: | Thu, 5 Jul 2001 22:50:43 +0400 (MSD) |
Uwe, you're quite right, it was stupid of me not
to
post an example and I apologise.
The basic functionality I want to achieve is
the
ability to run an interpreted language called
Lua, with which I'd like to create PostScript
graphics
-- EPS files. It is just an experiment but that's
what
I'd like to do -- dynamic EPS
generation. OK, I think I may be getting somewhere... I
compiled
Lout and found the line where system() is called. I
inserted a breakpoint and did a disk search for
a file called louti1, and found it. Examining the
content
fixed part of the puzzle for me, I think, So here's
my attempt
to explain what *I think* is happening. Please
tell me where I am wrong.
Suppose that I define something called
@Lua:
def @Lua
right x { def @Filter {Lua @FilterIn > @FilterOut} x } [[Aside: The command to run Lua is, not
surprisingly,
"Lua". A command called "dofile(...)" makes Lua
run
a file eg
dofile(foo.lua)
makes Lua run "foo.lua"]]
When I execute Lout with, say,
@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?
Now, Lua is called with the CONTENTS of
this temporary file (louti1) as its argument so
Lua sees
Lua dofile("c:\\lua\\hello.lua")
and (with Lua) the output is written to stdout
by default which is then piped (correct
term?)
to the second temporary file created from
the
expansion of @FilterOut -- a temporary file
called lout1, or similar, is created for the
purpose.
Lout then reads the content of lout1 and you're
done?
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.
Working on that now but any pointers
based
on the @Lua example about would be
great.
Best wishes and thanks to all for
putting up with my troubles -- no pain, no gain
I
guess (the gain had better be worth it
;-))
Thanks to all especially Uwe.
Graham
|
[Prev in Thread] | Current Thread | [Next in Thread] |