[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Preserving globals between chunks
- From: "Paul Moore" <p.f.moore@...>
- Date: Thu, 10 Jul 2008 15:32:51 +0100
On 10/07/2008, Thomas Lauer <thomas.lauer@virgin.net> wrote:
> Hey, you're giving me some ideas to chew over...
:-)
> Actually I am currently
> thinking of ways to execute Lua code directly in a batch file but with
> the current plugin architecture this won't turn out to be as elegant as
> I'd wish. Sigh.
As far as I know, there's no way to hook into the parser, but with
"Here documents" you don't really need to. You can simply use the
ability to read (redirected) stdin as follows:
lua << endlua
function f()
print("Hello, world")
end
endlua
That seems sufficiently clean to me. The only downside is that it
doesn't work in an interactive situation, but I'm not sure it would be
appropriate there anyway.
Paul.