On 7-5-2010 10:52, Taco Hoekwater wrote:
Peter Münster wrote:
On Thu, May 06 2010, Hans Hagen wrote:
\startbuffer[test] bla = nil \stopbuffer \savebuffer[test][../mytest.lua] \starttext \startluacode package.path = "../?.lua;;" require("mytest") \stopluacode \stoptext dofile "../mytest.lua"
Bad example...
mytest.lua is a module, so it must be loaded with require:
You cannot always replace 'require' with 'dofile', and for this reason it is important that package.path actually works as explained in the lua manual. (escrito had similar problems, and other external lua modules will run into it as well).
well, package path is supported (as is cpath) so it's more a question of why that paths fails .. maybe we need to explicitly assume ";" instead of the platform separator (tests on my machine work ok as windows has ; as separator) you can test this with adding an explcit ";" to libpaths = file.split_path(_path_,";") in data-lua.lua Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------