On Tue, May 20, 2008 at 1:18 AM, Frank Barknecht fbar@footils.org wrote:
Hallo, Mike McGonagle hat gesagt: // Mike McGonagle wrote:
On 5/19/08, Claude Heiland-Allen claudiusmaximus@goto10.org wrote:
Mike McGonagle wrote: There is support for one-off execution of .lua scripts found via Pd's
path
(relative to the object instance, not the original source file), use it
like
self:dofile("myscript.lua").
So, can I assume that this would effectively be the same as using "require"? I am sure there will be differences, but I am not trying to load a compiled binary, just curious if this has the same effect for .lua files...
As a workaround for now you could modify the Lua search path manually using something like:
package.path = "/my/pdlua/files/?.lua;" .. package.path
Cool, I will check it out...
before any requires. This adds the pattern "/my/pdlua/files/?.lua" to the path require() searches for modules. Lua doesn't know about directories, so you cannot us something like "pwd" instead here, of course.
Do you think it would make sense to push the directory of a *.pd_lua file to the front of package.path automatically? I guess I think it would.
Yes, I think that something like this would be taken care of by the "environment", as this would force any and all code used in PD to be specific to PD, having to add code that is only used in PDLua. Also considering that PD allows you to load something from the same directory, then PDLua I would think should too. How is Vessel handling 'require'?
Mike
Ciao
Frank Barknecht _ ______footils.org__
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list