<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 8, 2015 at 6:50 AM, Dirk Laurie <span dir="ltr"><<a href="mailto:dirk.laurie@gmail.com" target="_blank">dirk.laurie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It says: "Run the luaTeX typesetter on TEXNAME, usually creating<br>
TEXNAME.pdf. ... If  called  as texlua it acts as lua interpreter."<br>
<br>
There are two gotchas here.<br>
<br>
1. The clear implication is that if called as `luatex` it treats the input<br>
file as TeX. In fact, if the filename ends in `.lua`, it treats it as Lua.<br>
This is good, it is what the user would expect — but the manpage<br>
does not say so.<br>
<br>
2. Input cannot come from STDIN, a filename must be given,<br>
but `texlua myfile.lua` does not give the same behaviour as<br>
`lua myfile.lua` would have. The difference is subtle.<br>
<br>
The behaviour is as if the lines of `myfile.lua` were entered one<br>
by one in interactive mode. That is to say, the scope of all local<br>
variables ends at the end of the line they are defined on, unless<br>
they are inside an unclosed block. This causes a perfectly valid<br>
Lua script to fail when run by texlua.<br>
<br>
I cannot think of a good reason why this behaviour might be<br>
desirable. It IHMO would be preferable to make `texlua` behave<br>
exactly like `lua`. But if there is some subtle reason for it, maybe<br>
the manpage could warn the user about it.<br>
<br>
</blockquote></div><br>hm, could be...can you give an example ?</div><div class="gmail_extra"><div><br></div>-- <br><div class="gmail_signature">luigi<br></div>
</div></div>