Hello eLuers :)
In our present rom File System, how can we require() a Lua module ? The problem seems to be with Lua's way of searching the possible paths to the module. The very first one should do but Lua gives me an File not Found error looking for ./rom/filename.lua (yes, the file is there :), probably because our fs doesn't recognize the ./ notation. Is there a way to solve it today ? Best Dado -------------- next part -------------- An HTML attachment was scrubbed... URL: https://lists.berlios.de/pipermail/elua-dev/attachments/20081123/20eaa4b0/attachment.html |
Never tried that, and I'm not at all familiar with the modules part, but
we'll get the hang of it eventually. eLua doesn't have an "environment", so I'm curious about the default values of the environment variables relevant to the module subsystem. Will take a look. Best, Bogdan On Mon, Nov 24, 2008 at 3:08 AM, Dado Sutter <dadosutter at gmail.com> wrote: > Hello eLuers :) > In our present rom File System, how can we require() a Lua module ? > The problem seems to be with Lua's way of searching the possible paths to > the module. > The very first one should do but Lua gives me an File not Found error > looking for ./rom/filename.lua (yes, the file is there :), probably because > our fs doesn't recognize the ./ notation. > Is there a way to solve it today ? > > Best > Dado > > > _______________________________________________ > Elua-dev mailing list > Elua-dev at lists.berlios.de > https://lists.berlios.de/mailman/listinfo/elua-dev > > An HTML attachment was scrubbed... URL: https://lists.berlios.de/pipermail/elua-dev/attachments/20081124/963ba5e1/attachment.html |
Hello,
Lua modules are fundamental and all we need eLua to do now is very simple. require() has to be able to "find" a file in it's search path strategy, which is long (we won't care about all the options) but begins by a simple ./filename. Our FS has to be able to recognize the ./filename (we include /rom/ in the filename) notation. Other option would be to mod Lua to search for /filename first (before ./filename) but that sounds harder and changes Lua. This is very important for us now, to create some interesting support modules (I can talk about them all here if wanted :). I can take a look and implement it myself, after hearing some hint from you :) Thanksssssss :) Best Dado On Mon, Nov 24, 2008 at 12:29, Bogdan Marinescu <bogdan.marinescu at gmail.com>wrote: > Never tried that, and I'm not at all familiar with the modules part, but > we'll get the hang of it eventually. eLua doesn't have an "environment", so > I'm curious about the default values of the environment variables relevant > to the module subsystem. Will take a look. > > Best, > Bogdan > > On Mon, Nov 24, 2008 at 3:08 AM, Dado Sutter <dadosutter at gmail.com> wrote: > >> Hello eLuers :) >> In our present rom File System, how can we require() a Lua module ? >> The problem seems to be with Lua's way of searching the possible paths >> to the module. >> The very first one should do but Lua gives me an File not Found error >> looking for ./rom/filename.lua (yes, the file is there :), probably because >> our fs doesn't recognize the ./ notation. >> Is there a way to solve it today ? >> >> Best >> Dado >> >> >> _______________________________________________ >> Elua-dev mailing list >> Elua-dev at lists.berlios.de >> https://lists.berlios.de/mailman/listinfo/elua-dev >> >> > An HTML attachment was scrubbed... URL: https://lists.berlios.de/pipermail/elua-dev/attachments/20081124/82248aef/attachment.html |
Why do you need to support ./ at all? I don't quite see how that makes
sense here. The only reason that would make sense is if you want to execute a file from the current directory. If you just want to read a file (as require does) you don't need the ./. Another reason it does not make sense is, lua does not have a CWD set. Mike On Mon, Nov 24, 2008 at 1:07 PM, Dado Sutter <dado at pobox.com> wrote: > Hello, > Lua modules are fundamental and all we need eLua to do now is very > simple. > require() has to be able to "find" a file in it's search path strategy, > which is long (we won't care about all the options) but begins by a simple > ./filename. > Our FS has to be able to recognize the ./filename (we include /rom/ in > the filename) notation. > Other option would be to mod Lua to search for /filename first (before > ./filename) but that sounds harder and changes Lua. > This is very important for us now, to create some interesting support > modules (I can talk about them all here if wanted :). I can take a look and > implement it myself, after hearing some hint from you :) > Thanksssssss :) > > Best > Dado > > > > > On Mon, Nov 24, 2008 at 12:29, Bogdan Marinescu < > bogdan.marinescu at gmail.com> wrote: > >> Never tried that, and I'm not at all familiar with the modules part, but >> we'll get the hang of it eventually. eLua doesn't have an "environment", so >> I'm curious about the default values of the environment variables relevant >> to the module subsystem. Will take a look. >> >> Best, >> Bogdan >> >> On Mon, Nov 24, 2008 at 3:08 AM, Dado Sutter <dadosutter at gmail.com>wrote: >> >>> Hello eLuers :) >>> In our present rom File System, how can we require() a Lua module ? >>> The problem seems to be with Lua's way of searching the possible paths >>> to the module. >>> The very first one should do but Lua gives me an File not Found error >>> looking for ./rom/filename.lua (yes, the file is there :), probably because >>> our fs doesn't recognize the ./ notation. >>> Is there a way to solve it today ? >>> >>> Best >>> Dado >>> >>> >>> _______________________________________________ >>> Elua-dev mailing list >>> Elua-dev at lists.berlios.de >>> https://lists.berlios.de/mailman/listinfo/elua-dev >>> >>> >> > > _______________________________________________ > Elua-dev mailing list > Elua-dev at lists.berlios.de > https://lists.berlios.de/mailman/listinfo/elua-dev > > An HTML attachment was scrubbed... URL: https://lists.berlios.de/pipermail/elua-dev/attachments/20081124/5ac4f766/attachment.html |
Mike is right, we don't have CWD right now, as our only filesystem doesn't
even support directories :) Have you tried "require /rom/filename.lua" directly? If it doesn't work, we probably need to take care of LUA_PATH and LUA_CPATH somehow, I don't even know what are their "default" values currently. best, Bogdan On Mon, Nov 24, 2008 at 10:37 PM, Mike Panetta <panetta.mike at gmail.com>wrote: > Why do you need to support ./ at all? I don't quite see how that makes > sense here. The only reason that would make sense is if you want to execute > a file from the current directory. If you just want to read a file (as > require does) you don't need the ./. Another reason it does not make sense > is, lua does not have a CWD set. > > Mike > > > On Mon, Nov 24, 2008 at 1:07 PM, Dado Sutter <dado at pobox.com> wrote: > >> Hello, >> Lua modules are fundamental and all we need eLua to do now is very >> simple. >> require() has to be able to "find" a file in it's search path strategy, >> which is long (we won't care about all the options) but begins by a simple >> ./filename. >> Our FS has to be able to recognize the ./filename (we include /rom/ in >> the filename) notation. >> Other option would be to mod Lua to search for /filename first (before >> ./filename) but that sounds harder and changes Lua. >> This is very important for us now, to create some interesting support >> modules (I can talk about them all here if wanted :). I can take a look and >> implement it myself, after hearing some hint from you :) >> Thanksssssss :) >> >> Best >> Dado >> >> >> >> >> On Mon, Nov 24, 2008 at 12:29, Bogdan Marinescu < >> bogdan.marinescu at gmail.com> wrote: >> >>> Never tried that, and I'm not at all familiar with the modules part, but >>> we'll get the hang of it eventually. eLua doesn't have an "environment", so >>> I'm curious about the default values of the environment variables relevant >>> to the module subsystem. Will take a look. >>> >>> Best, >>> Bogdan >>> >>> On Mon, Nov 24, 2008 at 3:08 AM, Dado Sutter <dadosutter at gmail.com>wrote: >>> >>>> Hello eLuers :) >>>> In our present rom File System, how can we require() a Lua module ? >>>> The problem seems to be with Lua's way of searching the possible paths >>>> to the module. >>>> The very first one should do but Lua gives me an File not Found error >>>> looking for ./rom/filename.lua (yes, the file is there :), probably because >>>> our fs doesn't recognize the ./ notation. >>>> Is there a way to solve it today ? >>>> >>>> Best >>>> Dado >>>> >>>> >>>> _______________________________________________ >>>> Elua-dev mailing list >>>> Elua-dev at lists.berlios.de >>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>> >>>> >>> >> >> _______________________________________________ >> Elua-dev mailing list >> Elua-dev at lists.berlios.de >> https://lists.berlios.de/mailman/listinfo/elua-dev >> >> > > _______________________________________________ > Elua-dev mailing list > Elua-dev at lists.berlios.de > https://lists.berlios.de/mailman/listinfo/elua-dev > > An HTML attachment was scrubbed... URL: https://lists.berlios.de/pipermail/elua-dev/attachments/20081124/e3bae173/attachment-0001.html |
Thanks for the comments guys,
Sorry, I'm afraid I was not too clear. When we do a require(/rom/modulename) Lua appends the .lua to the module name before searching for the file and try to find a ./rom/modulename.lua in the FS (that is with a dot before the first dash) I couldn't find a way to code the module name, so that our FS provides Lua with what it wants. The module/require mecanism is ready and waiting for us to use it ! :) We just need to be able to provide the files the way it requires. About the rest of the path search list, not really important now (as all the files are under /rom), I can't remember exactly but it goes from looking from the current directory (but with the DotDash notation) to searching /usr/local/share, /user/local/bin and many others. It ends up looking for C modules to include too but that's another story.... Best Dado On Mon, Nov 24, 2008 at 18:50, Bogdan Marinescu <bogdan.marinescu at gmail.com>wrote: > Mike is right, we don't have CWD right now, as our only filesystem doesn't > even support directories :) Have you tried "require /rom/filename.lua" > directly? If it doesn't work, we probably need to take care of LUA_PATH and > LUA_CPATH somehow, I don't even know what are their "default" values > currently. > > best, > Bogdan > > > On Mon, Nov 24, 2008 at 10:37 PM, Mike Panetta <panetta.mike at gmail.com>wrote: > >> Why do you need to support ./ at all? I don't quite see how that makes >> sense here. The only reason that would make sense is if you want to execute >> a file from the current directory. If you just want to read a file (as >> require does) you don't need the ./. Another reason it does not make sense >> is, lua does not have a CWD set. >> >> Mike >> >> >> On Mon, Nov 24, 2008 at 1:07 PM, Dado Sutter <dado at pobox.com> wrote: >> >>> Hello, >>> Lua modules are fundamental and all we need eLua to do now is very >>> simple. >>> require() has to be able to "find" a file in it's search path >>> strategy, which is long (we won't care about all the options) but begins by >>> a simple ./filename. >>> Our FS has to be able to recognize the ./filename (we include /rom/ in >>> the filename) notation. >>> Other option would be to mod Lua to search for /filename first (before >>> ./filename) but that sounds harder and changes Lua. >>> This is very important for us now, to create some interesting support >>> modules (I can talk about them all here if wanted :). I can take a look and >>> implement it myself, after hearing some hint from you :) >>> Thanksssssss :) >>> >>> Best >>> Dado >>> >>> >>> >>> >>> On Mon, Nov 24, 2008 at 12:29, Bogdan Marinescu < >>> bogdan.marinescu at gmail.com> wrote: >>> >>>> Never tried that, and I'm not at all familiar with the modules part, but >>>> we'll get the hang of it eventually. eLua doesn't have an "environment", so >>>> I'm curious about the default values of the environment variables relevant >>>> to the module subsystem. Will take a look. >>>> >>>> Best, >>>> Bogdan >>>> >>>> On Mon, Nov 24, 2008 at 3:08 AM, Dado Sutter <dadosutter at gmail.com>wrote: >>>> >>>>> Hello eLuers :) >>>>> In our present rom File System, how can we require() a Lua module ? >>>>> The problem seems to be with Lua's way of searching the possible >>>>> paths to the module. >>>>> The very first one should do but Lua gives me an File not Found error >>>>> looking for ./rom/filename.lua (yes, the file is there :), probably because >>>>> our fs doesn't recognize the ./ notation. >>>>> Is there a way to solve it today ? >>>>> >>>>> Best >>>>> Dado >>>>> >>>>> >>>>> _______________________________________________ >>>>> Elua-dev mailing list >>>>> Elua-dev at lists.berlios.de >>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>> >>>>> >>>> >>> >>> _______________________________________________ >>> Elua-dev mailing list >>> Elua-dev at lists.berlios.de >>> https://lists.berlios.de/mailman/listinfo/elua-dev >>> >>> >> >> _______________________________________________ >> Elua-dev mailing list >> Elua-dev at lists.berlios.de >> https://lists.berlios.de/mailman/listinfo/elua-dev >> >> > An HTML attachment was scrubbed... URL: https://lists.berlios.de/pipermail/elua-dev/attachments/20081124/bc79e815/attachment.html |
Ahh! You need to change the search path in the lua executable to remove .
and add /rom. Then you should only need to say "require modname". While your at it, remove all the rest of the cruft from there too :P Mike On Mon, Nov 24, 2008 at 4:01 PM, Dado Sutter <dadosutter at gmail.com> wrote: > Thanks for the comments guys, > Sorry, I'm afraid I was not too clear. > When we do a require(/rom/modulename) Lua appends the .lua to the module > name before searching for the file and try to find a ./rom/modulename.lua in > the FS (that is with a dot before the first dash) > I couldn't find a way to code the module name, so that our FS provides > Lua with what it wants. > The module/require mecanism is ready and waiting for us to use it ! :) > We just need to be able to provide the files the way it requires. > About the rest of the path search list, not really important now (as all > the files are under /rom), I can't remember exactly but it goes from looking > from the current directory (but with the DotDash notation) to searching > /usr/local/share, /user/local/bin and many others. It ends up looking for C > modules to include too but that's another story.... > > Best > Dado > > > > > On Mon, Nov 24, 2008 at 18:50, Bogdan Marinescu < > bogdan.marinescu at gmail.com> wrote: > >> Mike is right, we don't have CWD right now, as our only filesystem doesn't >> even support directories :) Have you tried "require /rom/filename.lua" >> directly? If it doesn't work, we probably need to take care of LUA_PATH and >> LUA_CPATH somehow, I don't even know what are their "default" values >> currently. >> >> best, >> Bogdan >> >> >> On Mon, Nov 24, 2008 at 10:37 PM, Mike Panetta <panetta.mike at gmail.com>wrote: >> >>> Why do you need to support ./ at all? I don't quite see how that makes >>> sense here. The only reason that would make sense is if you want to execute >>> a file from the current directory. If you just want to read a file (as >>> require does) you don't need the ./. Another reason it does not make sense >>> is, lua does not have a CWD set. >>> >>> Mike >>> >>> >>> On Mon, Nov 24, 2008 at 1:07 PM, Dado Sutter <dado at pobox.com> wrote: >>> >>>> Hello, >>>> Lua modules are fundamental and all we need eLua to do now is very >>>> simple. >>>> require() has to be able to "find" a file in it's search path >>>> strategy, which is long (we won't care about all the options) but begins by >>>> a simple ./filename. >>>> Our FS has to be able to recognize the ./filename (we include /rom/ >>>> in the filename) notation. >>>> Other option would be to mod Lua to search for /filename first >>>> (before ./filename) but that sounds harder and changes Lua. >>>> This is very important for us now, to create some interesting support >>>> modules (I can talk about them all here if wanted :). I can take a look and >>>> implement it myself, after hearing some hint from you :) >>>> Thanksssssss :) >>>> >>>> Best >>>> Dado >>>> >>>> >>>> >>>> >>>> On Mon, Nov 24, 2008 at 12:29, Bogdan Marinescu < >>>> bogdan.marinescu at gmail.com> wrote: >>>> >>>>> Never tried that, and I'm not at all familiar with the modules part, >>>>> but we'll get the hang of it eventually. eLua doesn't have an "environment", >>>>> so I'm curious about the default values of the environment variables >>>>> relevant to the module subsystem. Will take a look. >>>>> >>>>> Best, >>>>> Bogdan >>>>> >>>>> On Mon, Nov 24, 2008 at 3:08 AM, Dado Sutter <dadosutter at gmail.com>wrote: >>>>> >>>>>> Hello eLuers :) >>>>>> In our present rom File System, how can we require() a Lua module ? >>>>>> The problem seems to be with Lua's way of searching the possible >>>>>> paths to the module. >>>>>> The very first one should do but Lua gives me an File not Found >>>>>> error looking for ./rom/filename.lua (yes, the file is there :), probably >>>>>> because our fs doesn't recognize the ./ notation. >>>>>> Is there a way to solve it today ? >>>>>> >>>>>> Best >>>>>> Dado >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Elua-dev mailing list >>>>>> Elua-dev at lists.berlios.de >>>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>>> >>>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Elua-dev mailing list >>>> Elua-dev at lists.berlios.de >>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>> >>>> >>> >>> _______________________________________________ >>> Elua-dev mailing list >>> Elua-dev at lists.berlios.de >>> https://lists.berlios.de/mailman/listinfo/elua-dev >>> >>> >> > > _______________________________________________ > Elua-dev mailing list > Elua-dev at lists.berlios.de > https://lists.berlios.de/mailman/listinfo/elua-dev > > An HTML attachment was scrubbed... URL: https://lists.berlios.de/pipermail/elua-dev/attachments/20081124/5dc2192c/attachment-0001.html |
In reply to this post by Dado Sutter
Resending to list ... what's that? Oh yes. AGAIN. *sigh*
---------- Forwarded message ---------- From: Bogdan Marinescu <bogdan.marinescu at gmail.com> Date: Mon, Nov 24, 2008 at 11:03 PM Subject: Re: [eLua-dev] Require(path/modulename) To: dado at pobox.com On Mon, Nov 24, 2008 at 11:01 PM, Dado Sutter <dadosutter at gmail.com> wrote: > Thanks for the comments guys, > Sorry, I'm afraid I was not too clear. > When we do a require(/rom/modulename) Lua appends the .lua to the module > name before searching for the file and try to find a ./rom/modulename.lua in > the FS (that is with a dot before the first dash) That's the problem then. Currently the best way to handle this would be to manipulate LUA_(C)PATH to look in "/rom". Something like "/rom/?.lua" unless I'm mistaken (I never used this feature before). Best, Bogdan > > > > On Mon, Nov 24, 2008 at 18:50, Bogdan Marinescu < > bogdan.marinescu at gmail.com> wrote: > >> Mike is right, we don't have CWD right now, as our only filesystem doesn't >> even support directories :) Have you tried "require /rom/filename.lua" >> directly? If it doesn't work, we probably need to take care of LUA_PATH and >> LUA_CPATH somehow, I don't even know what are their "default" values >> currently. >> >> best, >> Bogdan >> >> >> On Mon, Nov 24, 2008 at 10:37 PM, Mike Panetta <panetta.mike at gmail.com>wrote: >> >>> Why do you need to support ./ at all? I don't quite see how that makes >>> sense here. The only reason that would make sense is if you want to execute >>> a file from the current directory. If you just want to read a file (as >>> require does) you don't need the ./. Another reason it does not make sense >>> is, lua does not have a CWD set. >>> >>> Mike >>> >>> >>> On Mon, Nov 24, 2008 at 1:07 PM, Dado Sutter <dado at pobox.com> wrote: >>> >>>> Hello, >>>> Lua modules are fundamental and all we need eLua to do now is very >>>> simple. >>>> require() has to be able to "find" a file in it's search path >>>> strategy, which is long (we won't care about all the options) but begins by >>>> a simple ./filename. >>>> Our FS has to be able to recognize the ./filename (we include /rom/ >>>> in the filename) notation. >>>> Other option would be to mod Lua to search for /filename first >>>> (before ./filename) but that sounds harder and changes Lua. >>>> This is very important for us now, to create some interesting support >>>> modules (I can talk about them all here if wanted :). I can take a look and >>>> implement it myself, after hearing some hint from you :) >>>> Thanksssssss :) >>>> >>>> Best >>>> Dado >>>> >>>> >>>> >>>> >>>> On Mon, Nov 24, 2008 at 12:29, Bogdan Marinescu < >>>> bogdan.marinescu at gmail.com> wrote: >>>> >>>>> Never tried that, and I'm not at all familiar with the modules part, >>>>> but we'll get the hang of it eventually. eLua doesn't have an "environment", >>>>> so I'm curious about the default values of the environment variables >>>>> relevant to the module subsystem. Will take a look. >>>>> >>>>> Best, >>>>> Bogdan >>>>> >>>>> On Mon, Nov 24, 2008 at 3:08 AM, Dado Sutter <dadosutter at gmail.com>wrote: >>>>> >>>>>> Hello eLuers :) >>>>>> In our present rom File System, how can we require() a Lua module ? >>>>>> The problem seems to be with Lua's way of searching the possible >>>>>> paths to the module. >>>>>> The very first one should do but Lua gives me an File not Found >>>>>> error looking for ./rom/filename.lua (yes, the file is there :), probably >>>>>> because our fs doesn't recognize the ./ notation. >>>>>> Is there a way to solve it today ? >>>>>> >>>>>> Best >>>>>> Dado >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Elua-dev mailing list >>>>>> Elua-dev at lists.berlios.de >>>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>>> >>>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Elua-dev mailing list >>>> Elua-dev at lists.berlios.de >>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>> >>>> >>> >>> _______________________________________________ >>> Elua-dev mailing list >>> Elua-dev at lists.berlios.de >>> https://lists.berlios.de/mailman/listinfo/elua-dev >>> >>> >> > An HTML attachment was scrubbed... URL: https://lists.berlios.de/pipermail/elua-dev/attachments/20081124/6335b3bc/attachment.html |
In reply to this post by Mike Panetta
Thanks again guys,
I'll try to make my first Lua patch then :) But only when I find some time, later on this week. Mike, do you have an LM-3S8962 board up there ? So I can send you an eLua Pong for you to play on it ? :) Best Dado On Mon, Nov 24, 2008 at 19:06, Mike Panetta <panetta.mike at gmail.com> wrote: > Ahh! You need to change the search path in the lua executable to remove . > and add /rom. Then you should only need to say "require modname". While > your at it, remove all the rest of the cruft from there too :P > > Mike > > > On Mon, Nov 24, 2008 at 4:01 PM, Dado Sutter <dadosutter at gmail.com> wrote: > >> Thanks for the comments guys, >> Sorry, I'm afraid I was not too clear. >> When we do a require(/rom/modulename) Lua appends the .lua to the >> module name before searching for the file and try to find a >> ./rom/modulename.lua in the FS (that is with a dot before the first dash) >> I couldn't find a way to code the module name, so that our FS provides >> Lua with what it wants. >> The module/require mecanism is ready and waiting for us to use it ! :) >> We just need to be able to provide the files the way it requires. >> About the rest of the path search list, not really important now (as >> all the files are under /rom), I can't remember exactly but it goes from >> looking from the current directory (but with the DotDash notation) to >> searching /usr/local/share, /user/local/bin and many others. It ends up >> looking for C modules to include too but that's another story.... >> >> Best >> Dado >> >> >> >> >> On Mon, Nov 24, 2008 at 18:50, Bogdan Marinescu < >> bogdan.marinescu at gmail.com> wrote: >> >>> Mike is right, we don't have CWD right now, as our only filesystem >>> doesn't even support directories :) Have you tried "require >>> /rom/filename.lua" directly? If it doesn't work, we probably need to take >>> care of LUA_PATH and LUA_CPATH somehow, I don't even know what are their >>> "default" values currently. >>> >>> best, >>> Bogdan >>> >>> >>> On Mon, Nov 24, 2008 at 10:37 PM, Mike Panetta <panetta.mike at gmail.com>wrote: >>> >>>> Why do you need to support ./ at all? I don't quite see how that makes >>>> sense here. The only reason that would make sense is if you want to execute >>>> a file from the current directory. If you just want to read a file (as >>>> require does) you don't need the ./. Another reason it does not make sense >>>> is, lua does not have a CWD set. >>>> >>>> Mike >>>> >>>> >>>> On Mon, Nov 24, 2008 at 1:07 PM, Dado Sutter <dado at pobox.com> wrote: >>>> >>>>> Hello, >>>>> Lua modules are fundamental and all we need eLua to do now is very >>>>> simple. >>>>> require() has to be able to "find" a file in it's search path >>>>> strategy, which is long (we won't care about all the options) but begins by >>>>> a simple ./filename. >>>>> Our FS has to be able to recognize the ./filename (we include /rom/ >>>>> in the filename) notation. >>>>> Other option would be to mod Lua to search for /filename first >>>>> (before ./filename) but that sounds harder and changes Lua. >>>>> This is very important for us now, to create some interesting >>>>> support modules (I can talk about them all here if wanted :). I can take a >>>>> look and implement it myself, after hearing some hint from you :) >>>>> Thanksssssss :) >>>>> >>>>> Best >>>>> Dado >>>>> >>>>> >>>>> >>>>> >>>>> On Mon, Nov 24, 2008 at 12:29, Bogdan Marinescu < >>>>> bogdan.marinescu at gmail.com> wrote: >>>>> >>>>>> Never tried that, and I'm not at all familiar with the modules part, >>>>>> but we'll get the hang of it eventually. eLua doesn't have an "environment", >>>>>> so I'm curious about the default values of the environment variables >>>>>> relevant to the module subsystem. Will take a look. >>>>>> >>>>>> Best, >>>>>> Bogdan >>>>>> >>>>>> On Mon, Nov 24, 2008 at 3:08 AM, Dado Sutter <dadosutter at gmail.com>wrote: >>>>>> >>>>>>> Hello eLuers :) >>>>>>> In our present rom File System, how can we require() a Lua module ? >>>>>>> The problem seems to be with Lua's way of searching the possible >>>>>>> paths to the module. >>>>>>> The very first one should do but Lua gives me an File not Found >>>>>>> error looking for ./rom/filename.lua (yes, the file is there :), probably >>>>>>> because our fs doesn't recognize the ./ notation. >>>>>>> Is there a way to solve it today ? >>>>>>> >>>>>>> Best >>>>>>> Dado >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Elua-dev mailing list >>>>>>> Elua-dev at lists.berlios.de >>>>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>>>> >>>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Elua-dev mailing list >>>>> Elua-dev at lists.berlios.de >>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Elua-dev mailing list >>>> Elua-dev at lists.berlios.de >>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>> >>>> >>> >> >> _______________________________________________ >> Elua-dev mailing list >> Elua-dev at lists.berlios.de >> https://lists.berlios.de/mailman/listinfo/elua-dev >> >> > > _______________________________________________ > Elua-dev mailing list > Elua-dev at lists.berlios.de > https://lists.berlios.de/mailman/listinfo/elua-dev > > An HTML attachment was scrubbed... URL: https://lists.berlios.de/pipermail/elua-dev/attachments/20081124/49b94af7/attachment.html |
Yup I sure do. :) Unfortunately my project priorities changed so I do not
have access to the STM3210E-EVAL at the moment. Hopefully I will get that back soon! Its a nice toy. :) At least the LM3S8962 board is my personal one, so I don't have to worry about it disappearing. :) Mike On Mon, Nov 24, 2008 at 5:28 PM, Dado Sutter <dado at pobox.com> wrote: > Thanks again guys, > I'll try to make my first Lua patch then :) > But only when I find some time, later on this week. > Mike, do you have an LM-3S8962 board up there ? So I can send you an > eLua Pong for you to play on it ? :) > > Best > Dado > > > > > > On Mon, Nov 24, 2008 at 19:06, Mike Panetta <panetta.mike at gmail.com>wrote: > >> Ahh! You need to change the search path in the lua executable to remove . >> and add /rom. Then you should only need to say "require modname". While >> your at it, remove all the rest of the cruft from there too :P >> >> Mike >> >> >> On Mon, Nov 24, 2008 at 4:01 PM, Dado Sutter <dadosutter at gmail.com>wrote: >> >>> Thanks for the comments guys, >>> Sorry, I'm afraid I was not too clear. >>> When we do a require(/rom/modulename) Lua appends the .lua to the >>> module name before searching for the file and try to find a >>> ./rom/modulename.lua in the FS (that is with a dot before the first dash) >>> I couldn't find a way to code the module name, so that our FS provides >>> Lua with what it wants. >>> The module/require mecanism is ready and waiting for us to use it ! :) >>> >>> We just need to be able to provide the files the way it requires. >>> About the rest of the path search list, not really important now (as >>> all the files are under /rom), I can't remember exactly but it goes from >>> looking from the current directory (but with the DotDash notation) to >>> searching /usr/local/share, /user/local/bin and many others. It ends up >>> looking for C modules to include too but that's another story.... >>> >>> Best >>> Dado >>> >>> >>> >>> >>> On Mon, Nov 24, 2008 at 18:50, Bogdan Marinescu < >>> bogdan.marinescu at gmail.com> wrote: >>> >>>> Mike is right, we don't have CWD right now, as our only filesystem >>>> doesn't even support directories :) Have you tried "require >>>> /rom/filename.lua" directly? If it doesn't work, we probably need to take >>>> care of LUA_PATH and LUA_CPATH somehow, I don't even know what are their >>>> "default" values currently. >>>> >>>> best, >>>> Bogdan >>>> >>>> >>>> On Mon, Nov 24, 2008 at 10:37 PM, Mike Panetta <panetta.mike at gmail.com>wrote: >>>> >>>>> Why do you need to support ./ at all? I don't quite see how that makes >>>>> sense here. The only reason that would make sense is if you want to execute >>>>> a file from the current directory. If you just want to read a file (as >>>>> require does) you don't need the ./. Another reason it does not make sense >>>>> is, lua does not have a CWD set. >>>>> >>>>> Mike >>>>> >>>>> >>>>> On Mon, Nov 24, 2008 at 1:07 PM, Dado Sutter <dado at pobox.com> wrote: >>>>> >>>>>> Hello, >>>>>> Lua modules are fundamental and all we need eLua to do now is very >>>>>> simple. >>>>>> require() has to be able to "find" a file in it's search path >>>>>> strategy, which is long (we won't care about all the options) but begins by >>>>>> a simple ./filename. >>>>>> Our FS has to be able to recognize the ./filename (we include /rom/ >>>>>> in the filename) notation. >>>>>> Other option would be to mod Lua to search for /filename first >>>>>> (before ./filename) but that sounds harder and changes Lua. >>>>>> This is very important for us now, to create some interesting >>>>>> support modules (I can talk about them all here if wanted :). I can take a >>>>>> look and implement it myself, after hearing some hint from you :) >>>>>> Thanksssssss :) >>>>>> >>>>>> Best >>>>>> Dado >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Mon, Nov 24, 2008 at 12:29, Bogdan Marinescu < >>>>>> bogdan.marinescu at gmail.com> wrote: >>>>>> >>>>>>> Never tried that, and I'm not at all familiar with the modules part, >>>>>>> but we'll get the hang of it eventually. eLua doesn't have an "environment", >>>>>>> so I'm curious about the default values of the environment variables >>>>>>> relevant to the module subsystem. Will take a look. >>>>>>> >>>>>>> Best, >>>>>>> Bogdan >>>>>>> >>>>>>> On Mon, Nov 24, 2008 at 3:08 AM, Dado Sutter <dadosutter at gmail.com>wrote: >>>>>>> >>>>>>>> Hello eLuers :) >>>>>>>> In our present rom File System, how can we require() a Lua module >>>>>>>> ? >>>>>>>> The problem seems to be with Lua's way of searching the possible >>>>>>>> paths to the module. >>>>>>>> The very first one should do but Lua gives me an File not Found >>>>>>>> error looking for ./rom/filename.lua (yes, the file is there :), probably >>>>>>>> because our fs doesn't recognize the ./ notation. >>>>>>>> Is there a way to solve it today ? >>>>>>>> >>>>>>>> Best >>>>>>>> Dado >>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Elua-dev mailing list >>>>>>>> Elua-dev at lists.berlios.de >>>>>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Elua-dev mailing list >>>>>> Elua-dev at lists.berlios.de >>>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Elua-dev mailing list >>>>> Elua-dev at lists.berlios.de >>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>> >>>>> >>>> >>> >>> _______________________________________________ >>> Elua-dev mailing list >>> Elua-dev at lists.berlios.de >>> https://lists.berlios.de/mailman/listinfo/elua-dev >>> >>> >> >> _______________________________________________ >> Elua-dev mailing list >> Elua-dev at lists.berlios.de >> https://lists.berlios.de/mailman/listinfo/elua-dev >> >> > > _______________________________________________ > Elua-dev mailing list > Elua-dev at lists.berlios.de > https://lists.berlios.de/mailman/listinfo/elua-dev > > An HTML attachment was scrubbed... URL: https://lists.berlios.de/pipermail/elua-dev/attachments/20081124/48b251bf/attachment-0001.html |
That is great news ! :)
We will send you a little Pong tomorrow then ! :) It is an autorun image, built upon my RIT display module (that today we finally learned that it will be legally possible to include in eLua !!!). I'll send you the Lua code too, although the final version will be built upon a module that depends on this require() issue discussed here. I've commited code for an ls (or dir) shell comand today and intend to commit the RIT display very soon now. It is very bad to hear that you can't play with the STM3210E-EVAL anymore :( :( but then you can improve our discussions on new modules to the LM3S platform ! We expect to be playing with an AVR32 in the next week too, one here and one in Bucarest ! Best Dado On Mon, Nov 24, 2008 at 21:41, Mike Panetta <panetta.mike at gmail.com> wrote: > Yup I sure do. :) Unfortunately my project priorities changed so I do not > have access to the STM3210E-EVAL at the moment. Hopefully I will get that > back soon! Its a nice toy. :) At least the LM3S8962 board is my personal > one, so I don't have to worry about it disappearing. :) > > Mike > > > On Mon, Nov 24, 2008 at 5:28 PM, Dado Sutter <dado at pobox.com> wrote: > >> Thanks again guys, >> I'll try to make my first Lua patch then :) >> But only when I find some time, later on this week. >> Mike, do you have an LM-3S8962 board up there ? So I can send you an >> eLua Pong for you to play on it ? :) >> >> Best >> Dado >> >> >> >> >> >> On Mon, Nov 24, 2008 at 19:06, Mike Panetta <panetta.mike at gmail.com>wrote: >> >>> Ahh! You need to change the search path in the lua executable to remove >>> . and add /rom. Then you should only need to say "require modname". While >>> your at it, remove all the rest of the cruft from there too :P >>> >>> Mike >>> >>> >>> On Mon, Nov 24, 2008 at 4:01 PM, Dado Sutter <dadosutter at gmail.com>wrote: >>> >>>> Thanks for the comments guys, >>>> Sorry, I'm afraid I was not too clear. >>>> When we do a require(/rom/modulename) Lua appends the .lua to the >>>> module name before searching for the file and try to find a >>>> ./rom/modulename.lua in the FS (that is with a dot before the first dash) >>>> I couldn't find a way to code the module name, so that our FS >>>> provides Lua with what it wants. >>>> The module/require mecanism is ready and waiting for us to use it ! >>>> :) >>>> We just need to be able to provide the files the way it requires. >>>> About the rest of the path search list, not really important now (as >>>> all the files are under /rom), I can't remember exactly but it goes from >>>> looking from the current directory (but with the DotDash notation) to >>>> searching /usr/local/share, /user/local/bin and many others. It ends up >>>> looking for C modules to include too but that's another story.... >>>> >>>> Best >>>> Dado >>>> >>>> >>>> >>>> >>>> On Mon, Nov 24, 2008 at 18:50, Bogdan Marinescu < >>>> bogdan.marinescu at gmail.com> wrote: >>>> >>>>> Mike is right, we don't have CWD right now, as our only filesystem >>>>> doesn't even support directories :) Have you tried "require >>>>> /rom/filename.lua" directly? If it doesn't work, we probably need to take >>>>> care of LUA_PATH and LUA_CPATH somehow, I don't even know what are their >>>>> "default" values currently. >>>>> >>>>> best, >>>>> Bogdan >>>>> >>>>> >>>>> On Mon, Nov 24, 2008 at 10:37 PM, Mike Panetta <panetta.mike at gmail.com >>>>> > wrote: >>>>> >>>>>> Why do you need to support ./ at all? I don't quite see how that >>>>>> makes sense here. The only reason that would make sense is if you want to >>>>>> execute a file from the current directory. If you just want to read a file >>>>>> (as require does) you don't need the ./. Another reason it does not make >>>>>> sense is, lua does not have a CWD set. >>>>>> >>>>>> Mike >>>>>> >>>>>> >>>>>> On Mon, Nov 24, 2008 at 1:07 PM, Dado Sutter <dado at pobox.com> wrote: >>>>>> >>>>>>> Hello, >>>>>>> Lua modules are fundamental and all we need eLua to do now is very >>>>>>> simple. >>>>>>> require() has to be able to "find" a file in it's search path >>>>>>> strategy, which is long (we won't care about all the options) but begins by >>>>>>> a simple ./filename. >>>>>>> Our FS has to be able to recognize the ./filename (we include >>>>>>> /rom/ in the filename) notation. >>>>>>> Other option would be to mod Lua to search for /filename first >>>>>>> (before ./filename) but that sounds harder and changes Lua. >>>>>>> This is very important for us now, to create some interesting >>>>>>> support modules (I can talk about them all here if wanted :). I can take a >>>>>>> look and implement it myself, after hearing some hint from you :) >>>>>>> Thanksssssss :) >>>>>>> >>>>>>> Best >>>>>>> Dado >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Mon, Nov 24, 2008 at 12:29, Bogdan Marinescu < >>>>>>> bogdan.marinescu at gmail.com> wrote: >>>>>>> >>>>>>>> Never tried that, and I'm not at all familiar with the modules part, >>>>>>>> but we'll get the hang of it eventually. eLua doesn't have an "environment", >>>>>>>> so I'm curious about the default values of the environment variables >>>>>>>> relevant to the module subsystem. Will take a look. >>>>>>>> >>>>>>>> Best, >>>>>>>> Bogdan >>>>>>>> >>>>>>>> On Mon, Nov 24, 2008 at 3:08 AM, Dado Sutter <dadosutter at gmail.com>wrote: >>>>>>>> >>>>>>>>> Hello eLuers :) >>>>>>>>> In our present rom File System, how can we require() a Lua module >>>>>>>>> ? >>>>>>>>> The problem seems to be with Lua's way of searching the possible >>>>>>>>> paths to the module. >>>>>>>>> The very first one should do but Lua gives me an File not Found >>>>>>>>> error looking for ./rom/filename.lua (yes, the file is there :), probably >>>>>>>>> because our fs doesn't recognize the ./ notation. >>>>>>>>> Is there a way to solve it today ? >>>>>>>>> >>>>>>>>> Best >>>>>>>>> Dado >>>>>>>>> >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Elua-dev mailing list >>>>>>>>> Elua-dev at lists.berlios.de >>>>>>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Elua-dev mailing list >>>>>>> Elua-dev at lists.berlios.de >>>>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>>>> >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Elua-dev mailing list >>>>>> Elua-dev at lists.berlios.de >>>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>>> >>>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Elua-dev mailing list >>>> Elua-dev at lists.berlios.de >>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>> >>>> >>> >>> _______________________________________________ >>> Elua-dev mailing list >>> Elua-dev at lists.berlios.de >>> https://lists.berlios.de/mailman/listinfo/elua-dev >>> >>> >> >> _______________________________________________ >> Elua-dev mailing list >> Elua-dev at lists.berlios.de >> https://lists.berlios.de/mailman/listinfo/elua-dev >> >> > > _______________________________________________ > Elua-dev mailing list > Elua-dev at lists.berlios.de > https://lists.berlios.de/mailman/listinfo/elua-dev > > An HTML attachment was scrubbed... URL: https://lists.berlios.de/pipermail/elua-dev/attachments/20081124/d886ccc8/attachment.html |
In the end it seems to be just a matter of defining LUA_PATH_DEFAULT
properly in luaconf.h. Best, Bogdan On Tue, Nov 25, 2008 at 2:29 AM, Dado Sutter <dado at pobox.com> wrote: > That is great news ! :) > We will send you a little Pong tomorrow then ! :) > It is an autorun image, built upon my RIT display module (that today we > finally learned that it will be legally possible to include in eLua !!!). > I'll send you the Lua code too, although the final version will be built > upon a module that depends on this require() issue discussed here. > I've commited code for an ls (or dir) shell comand today and intend to > commit the RIT display very soon now. > It is very bad to hear that you can't play with the STM3210E-EVAL > anymore :( :( but then you can improve our discussions on new modules to the > LM3S platform ! > We expect to be playing with an AVR32 in the next week too, one here and > one in Bucarest ! > > Best > Dado > > > > On Mon, Nov 24, 2008 at 21:41, Mike Panetta <panetta.mike at gmail.com>wrote: > >> Yup I sure do. :) Unfortunately my project priorities changed so I do not >> have access to the STM3210E-EVAL at the moment. Hopefully I will get that >> back soon! Its a nice toy. :) At least the LM3S8962 board is my personal >> one, so I don't have to worry about it disappearing. :) >> >> Mike >> >> >> On Mon, Nov 24, 2008 at 5:28 PM, Dado Sutter <dado at pobox.com> wrote: >> >>> Thanks again guys, >>> I'll try to make my first Lua patch then :) >>> But only when I find some time, later on this week. >>> Mike, do you have an LM-3S8962 board up there ? So I can send you an >>> eLua Pong for you to play on it ? :) >>> >>> Best >>> Dado >>> >>> >>> >>> >>> >>> On Mon, Nov 24, 2008 at 19:06, Mike Panetta <panetta.mike at gmail.com>wrote: >>> >>>> Ahh! You need to change the search path in the lua executable to remove >>>> . and add /rom. Then you should only need to say "require modname". While >>>> your at it, remove all the rest of the cruft from there too :P >>>> >>>> Mike >>>> >>>> >>>> On Mon, Nov 24, 2008 at 4:01 PM, Dado Sutter <dadosutter at gmail.com>wrote: >>>> >>>>> Thanks for the comments guys, >>>>> Sorry, I'm afraid I was not too clear. >>>>> When we do a require(/rom/modulename) Lua appends the .lua to the >>>>> module name before searching for the file and try to find a >>>>> ./rom/modulename.lua in the FS (that is with a dot before the first dash) >>>>> I couldn't find a way to code the module name, so that our FS >>>>> provides Lua with what it wants. >>>>> The module/require mecanism is ready and waiting for us to use it ! >>>>> :) >>>>> We just need to be able to provide the files the way it requires. >>>>> About the rest of the path search list, not really important now (as >>>>> all the files are under /rom), I can't remember exactly but it goes from >>>>> looking from the current directory (but with the DotDash notation) to >>>>> searching /usr/local/share, /user/local/bin and many others. It ends up >>>>> looking for C modules to include too but that's another story.... >>>>> >>>>> Best >>>>> Dado >>>>> >>>>> >>>>> >>>>> >>>>> On Mon, Nov 24, 2008 at 18:50, Bogdan Marinescu < >>>>> bogdan.marinescu at gmail.com> wrote: >>>>> >>>>>> Mike is right, we don't have CWD right now, as our only filesystem >>>>>> doesn't even support directories :) Have you tried "require >>>>>> /rom/filename.lua" directly? If it doesn't work, we probably need to take >>>>>> care of LUA_PATH and LUA_CPATH somehow, I don't even know what are their >>>>>> "default" values currently. >>>>>> >>>>>> best, >>>>>> Bogdan >>>>>> >>>>>> >>>>>> On Mon, Nov 24, 2008 at 10:37 PM, Mike Panetta < >>>>>> panetta.mike at gmail.com> wrote: >>>>>> >>>>>>> Why do you need to support ./ at all? I don't quite see how that >>>>>>> makes sense here. The only reason that would make sense is if you want to >>>>>>> execute a file from the current directory. If you just want to read a file >>>>>>> (as require does) you don't need the ./. Another reason it does not make >>>>>>> sense is, lua does not have a CWD set. >>>>>>> >>>>>>> Mike >>>>>>> >>>>>>> >>>>>>> On Mon, Nov 24, 2008 at 1:07 PM, Dado Sutter <dado at pobox.com> wrote: >>>>>>> >>>>>>>> Hello, >>>>>>>> Lua modules are fundamental and all we need eLua to do now is >>>>>>>> very simple. >>>>>>>> require() has to be able to "find" a file in it's search path >>>>>>>> strategy, which is long (we won't care about all the options) but begins by >>>>>>>> a simple ./filename. >>>>>>>> Our FS has to be able to recognize the ./filename (we include >>>>>>>> /rom/ in the filename) notation. >>>>>>>> Other option would be to mod Lua to search for /filename first >>>>>>>> (before ./filename) but that sounds harder and changes Lua. >>>>>>>> This is very important for us now, to create some interesting >>>>>>>> support modules (I can talk about them all here if wanted :). I can take a >>>>>>>> look and implement it myself, after hearing some hint from you :) >>>>>>>> Thanksssssss :) >>>>>>>> >>>>>>>> Best >>>>>>>> Dado >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On Mon, Nov 24, 2008 at 12:29, Bogdan Marinescu < >>>>>>>> bogdan.marinescu at gmail.com> wrote: >>>>>>>> >>>>>>>>> Never tried that, and I'm not at all familiar with the modules >>>>>>>>> part, but we'll get the hang of it eventually. eLua doesn't have an >>>>>>>>> "environment", so I'm curious about the default values of the environment >>>>>>>>> variables relevant to the module subsystem. Will take a look. >>>>>>>>> >>>>>>>>> Best, >>>>>>>>> Bogdan >>>>>>>>> >>>>>>>>> On Mon, Nov 24, 2008 at 3:08 AM, Dado Sutter <dadosutter at gmail.com >>>>>>>>> > wrote: >>>>>>>>> >>>>>>>>>> Hello eLuers :) >>>>>>>>>> In our present rom File System, how can we require() a Lua >>>>>>>>>> module ? >>>>>>>>>> The problem seems to be with Lua's way of searching the possible >>>>>>>>>> paths to the module. >>>>>>>>>> The very first one should do but Lua gives me an File not Found >>>>>>>>>> error looking for ./rom/filename.lua (yes, the file is there :), probably >>>>>>>>>> because our fs doesn't recognize the ./ notation. >>>>>>>>>> Is there a way to solve it today ? >>>>>>>>>> >>>>>>>>>> Best >>>>>>>>>> Dado >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> _______________________________________________ >>>>>>>>>> Elua-dev mailing list >>>>>>>>>> Elua-dev at lists.berlios.de >>>>>>>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Elua-dev mailing list >>>>>>>> Elua-dev at lists.berlios.de >>>>>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Elua-dev mailing list >>>>>>> Elua-dev at lists.berlios.de >>>>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>>>> >>>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Elua-dev mailing list >>>>> Elua-dev at lists.berlios.de >>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Elua-dev mailing list >>>> Elua-dev at lists.berlios.de >>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>> >>>> >>> >>> _______________________________________________ >>> Elua-dev mailing list >>> Elua-dev at lists.berlios.de >>> https://lists.berlios.de/mailman/listinfo/elua-dev >>> >>> >> >> _______________________________________________ >> Elua-dev mailing list >> Elua-dev at lists.berlios.de >> https://lists.berlios.de/mailman/listinfo/elua-dev >> >> > > _______________________________________________ > Elua-dev mailing list > Elua-dev at lists.berlios.de > https://lists.berlios.de/mailman/listinfo/elua-dev > > An HTML attachment was scrubbed... URL: https://lists.berlios.de/pipermail/elua-dev/attachments/20081125/a2e08d72/attachment.html |
Great !
I'll check it today but I'll only be able to test it on a board tomorrow on the Lab. Thanksssssssssss Best Dado On Tue, Nov 25, 2008 at 17:57, Bogdan Marinescu <bogdan.marinescu at gmail.com>wrote: > In the end it seems to be just a matter of defining LUA_PATH_DEFAULT > properly in luaconf.h. > > Best, > Bogdan > > > On Tue, Nov 25, 2008 at 2:29 AM, Dado Sutter <dado at pobox.com> wrote: > >> That is great news ! :) >> We will send you a little Pong tomorrow then ! :) >> It is an autorun image, built upon my RIT display module (that today we >> finally learned that it will be legally possible to include in eLua !!!). >> I'll send you the Lua code too, although the final version will be built >> upon a module that depends on this require() issue discussed here. >> I've commited code for an ls (or dir) shell comand today and intend to >> commit the RIT display very soon now. >> It is very bad to hear that you can't play with the STM3210E-EVAL >> anymore :( :( but then you can improve our discussions on new modules to the >> LM3S platform ! >> We expect to be playing with an AVR32 in the next week too, one here >> and one in Bucarest ! >> >> Best >> Dado >> >> >> >> On Mon, Nov 24, 2008 at 21:41, Mike Panetta <panetta.mike at gmail.com>wrote: >> >>> Yup I sure do. :) Unfortunately my project priorities changed so I do >>> not have access to the STM3210E-EVAL at the moment. Hopefully I will get >>> that back soon! Its a nice toy. :) At least the LM3S8962 board is my >>> personal one, so I don't have to worry about it disappearing. :) >>> >>> Mike >>> >>> >>> On Mon, Nov 24, 2008 at 5:28 PM, Dado Sutter <dado at pobox.com> wrote: >>> >>>> Thanks again guys, >>>> I'll try to make my first Lua patch then :) >>>> But only when I find some time, later on this week. >>>> Mike, do you have an LM-3S8962 board up there ? So I can send you an >>>> eLua Pong for you to play on it ? :) >>>> >>>> Best >>>> Dado >>>> >>>> >>>> >>>> >>>> >>>> On Mon, Nov 24, 2008 at 19:06, Mike Panetta <panetta.mike at gmail.com>wrote: >>>> >>>>> Ahh! You need to change the search path in the lua executable to >>>>> remove . and add /rom. Then you should only need to say "require modname". >>>>> While your at it, remove all the rest of the cruft from there too :P >>>>> >>>>> Mike >>>>> >>>>> >>>>> On Mon, Nov 24, 2008 at 4:01 PM, Dado Sutter <dadosutter at gmail.com>wrote: >>>>> >>>>>> Thanks for the comments guys, >>>>>> Sorry, I'm afraid I was not too clear. >>>>>> When we do a require(/rom/modulename) Lua appends the .lua to the >>>>>> module name before searching for the file and try to find a >>>>>> ./rom/modulename.lua in the FS (that is with a dot before the first dash) >>>>>> I couldn't find a way to code the module name, so that our FS >>>>>> provides Lua with what it wants. >>>>>> The module/require mecanism is ready and waiting for us to use it ! >>>>>> :) >>>>>> We just need to be able to provide the files the way it requires. >>>>>> About the rest of the path search list, not really important now >>>>>> (as all the files are under /rom), I can't remember exactly but it goes from >>>>>> looking from the current directory (but with the DotDash notation) to >>>>>> searching /usr/local/share, /user/local/bin and many others. It ends up >>>>>> looking for C modules to include too but that's another story.... >>>>>> >>>>>> Best >>>>>> Dado >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Mon, Nov 24, 2008 at 18:50, Bogdan Marinescu < >>>>>> bogdan.marinescu at gmail.com> wrote: >>>>>> >>>>>>> Mike is right, we don't have CWD right now, as our only filesystem >>>>>>> doesn't even support directories :) Have you tried "require >>>>>>> /rom/filename.lua" directly? If it doesn't work, we probably need to take >>>>>>> care of LUA_PATH and LUA_CPATH somehow, I don't even know what are their >>>>>>> "default" values currently. >>>>>>> >>>>>>> best, >>>>>>> Bogdan >>>>>>> >>>>>>> >>>>>>> On Mon, Nov 24, 2008 at 10:37 PM, Mike Panetta < >>>>>>> panetta.mike at gmail.com> wrote: >>>>>>> >>>>>>>> Why do you need to support ./ at all? I don't quite see how that >>>>>>>> makes sense here. The only reason that would make sense is if you want to >>>>>>>> execute a file from the current directory. If you just want to read a file >>>>>>>> (as require does) you don't need the ./. Another reason it does not make >>>>>>>> sense is, lua does not have a CWD set. >>>>>>>> >>>>>>>> Mike >>>>>>>> >>>>>>>> >>>>>>>> On Mon, Nov 24, 2008 at 1:07 PM, Dado Sutter <dado at pobox.com>wrote: >>>>>>>> >>>>>>>>> Hello, >>>>>>>>> Lua modules are fundamental and all we need eLua to do now is >>>>>>>>> very simple. >>>>>>>>> require() has to be able to "find" a file in it's search path >>>>>>>>> strategy, which is long (we won't care about all the options) but begins by >>>>>>>>> a simple ./filename. >>>>>>>>> Our FS has to be able to recognize the ./filename (we include >>>>>>>>> /rom/ in the filename) notation. >>>>>>>>> Other option would be to mod Lua to search for /filename first >>>>>>>>> (before ./filename) but that sounds harder and changes Lua. >>>>>>>>> This is very important for us now, to create some interesting >>>>>>>>> support modules (I can talk about them all here if wanted :). I can take a >>>>>>>>> look and implement it myself, after hearing some hint from you :) >>>>>>>>> Thanksssssss :) >>>>>>>>> >>>>>>>>> Best >>>>>>>>> Dado >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> On Mon, Nov 24, 2008 at 12:29, Bogdan Marinescu < >>>>>>>>> bogdan.marinescu at gmail.com> wrote: >>>>>>>>> >>>>>>>>>> Never tried that, and I'm not at all familiar with the modules >>>>>>>>>> part, but we'll get the hang of it eventually. eLua doesn't have an >>>>>>>>>> "environment", so I'm curious about the default values of the environment >>>>>>>>>> variables relevant to the module subsystem. Will take a look. >>>>>>>>>> >>>>>>>>>> Best, >>>>>>>>>> Bogdan >>>>>>>>>> >>>>>>>>>> On Mon, Nov 24, 2008 at 3:08 AM, Dado Sutter < >>>>>>>>>> dadosutter at gmail.com> wrote: >>>>>>>>>> >>>>>>>>>>> Hello eLuers :) >>>>>>>>>>> In our present rom File System, how can we require() a Lua >>>>>>>>>>> module ? >>>>>>>>>>> The problem seems to be with Lua's way of searching the >>>>>>>>>>> possible paths to the module. >>>>>>>>>>> The very first one should do but Lua gives me an File not Found >>>>>>>>>>> error looking for ./rom/filename.lua (yes, the file is there :), probably >>>>>>>>>>> because our fs doesn't recognize the ./ notation. >>>>>>>>>>> Is there a way to solve it today ? >>>>>>>>>>> >>>>>>>>>>> Best >>>>>>>>>>> Dado >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> _______________________________________________ >>>>>>>>>>> Elua-dev mailing list >>>>>>>>>>> Elua-dev at lists.berlios.de >>>>>>>>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Elua-dev mailing list >>>>>>>>> Elua-dev at lists.berlios.de >>>>>>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Elua-dev mailing list >>>>>>>> Elua-dev at lists.berlios.de >>>>>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Elua-dev mailing list >>>>>> Elua-dev at lists.berlios.de >>>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Elua-dev mailing list >>>>> Elua-dev at lists.berlios.de >>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Elua-dev mailing list >>>> Elua-dev at lists.berlios.de >>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>> >>>> >>> >>> _______________________________________________ >>> Elua-dev mailing list >>> Elua-dev at lists.berlios.de >>> https://lists.berlios.de/mailman/listinfo/elua-dev >>> >>> >> >> _______________________________________________ >> Elua-dev mailing list >> Elua-dev at lists.berlios.de >> https://lists.berlios.de/mailman/listinfo/elua-dev >> >> > An HTML attachment was scrubbed... URL: https://lists.berlios.de/pipermail/elua-dev/attachments/20081125/87caa145/attachment-0001.html |
Hello guys,
Couldn't wait till tomorrow to check on a kit with eLua ! :) So I got Lua source code, reconfigured LUA_PATH_DEFAULT to search on a local /rom (discarding the rest of the cruft :), put a module there and ............. it works !!!!!!!!!!!!! :) Thank you guys for the tips ! Now we'll have require()/module() scheme working in eLua too !!!!!!!!!!!! Best Dado On Tue, Nov 25, 2008 at 18:01, Dado Sutter <dado at pobox.com> wrote: > Great ! > I'll check it today but I'll only be able to test it on a board tomorrow > on the Lab. > > Thanksssssssssss > Best > Dado > > > > > On Tue, Nov 25, 2008 at 17:57, Bogdan Marinescu < > bogdan.marinescu at gmail.com> wrote: > >> In the end it seems to be just a matter of defining LUA_PATH_DEFAULT >> properly in luaconf.h. >> >> Best, >> Bogdan >> >> >> On Tue, Nov 25, 2008 at 2:29 AM, Dado Sutter <dado at pobox.com> wrote: >> >>> That is great news ! :) >>> We will send you a little Pong tomorrow then ! :) >>> It is an autorun image, built upon my RIT display module (that today >>> we finally learned that it will be legally possible to include in eLua !!!). >>> I'll send you the Lua code too, although the final version will be built >>> upon a module that depends on this require() issue discussed here. >>> I've commited code for an ls (or dir) shell comand today and intend to >>> commit the RIT display very soon now. >>> It is very bad to hear that you can't play with the STM3210E-EVAL >>> anymore :( :( but then you can improve our discussions on new modules to the >>> LM3S platform ! >>> We expect to be playing with an AVR32 in the next week too, one here >>> and one in Bucarest ! >>> >>> Best >>> Dado >>> >>> >>> >>> On Mon, Nov 24, 2008 at 21:41, Mike Panetta <panetta.mike at gmail.com>wrote: >>> >>>> Yup I sure do. :) Unfortunately my project priorities changed so I do >>>> not have access to the STM3210E-EVAL at the moment. Hopefully I will get >>>> that back soon! Its a nice toy. :) At least the LM3S8962 board is my >>>> personal one, so I don't have to worry about it disappearing. :) >>>> >>>> Mike >>>> >>>> >>>> On Mon, Nov 24, 2008 at 5:28 PM, Dado Sutter <dado at pobox.com> wrote: >>>> >>>>> Thanks again guys, >>>>> I'll try to make my first Lua patch then :) >>>>> But only when I find some time, later on this week. >>>>> Mike, do you have an LM-3S8962 board up there ? So I can send you an >>>>> eLua Pong for you to play on it ? :) >>>>> >>>>> Best >>>>> Dado >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> On Mon, Nov 24, 2008 at 19:06, Mike Panetta <panetta.mike at gmail.com>wrote: >>>>> >>>>>> Ahh! You need to change the search path in the lua executable to >>>>>> remove . and add /rom. Then you should only need to say "require modname". >>>>>> While your at it, remove all the rest of the cruft from there too :P >>>>>> >>>>>> Mike >>>>>> >>>>>> >>>>>> On Mon, Nov 24, 2008 at 4:01 PM, Dado Sutter <dadosutter at gmail.com>wrote: >>>>>> >>>>>>> Thanks for the comments guys, >>>>>>> Sorry, I'm afraid I was not too clear. >>>>>>> When we do a require(/rom/modulename) Lua appends the .lua to the >>>>>>> module name before searching for the file and try to find a >>>>>>> ./rom/modulename.lua in the FS (that is with a dot before the first dash) >>>>>>> I couldn't find a way to code the module name, so that our FS >>>>>>> provides Lua with what it wants. >>>>>>> The module/require mecanism is ready and waiting for us to use it >>>>>>> ! :) >>>>>>> We just need to be able to provide the files the way it requires. >>>>>>> About the rest of the path search list, not really important now >>>>>>> (as all the files are under /rom), I can't remember exactly but it goes from >>>>>>> looking from the current directory (but with the DotDash notation) to >>>>>>> searching /usr/local/share, /user/local/bin and many others. It ends up >>>>>>> looking for C modules to include too but that's another story.... >>>>>>> >>>>>>> Best >>>>>>> Dado >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Mon, Nov 24, 2008 at 18:50, Bogdan Marinescu < >>>>>>> bogdan.marinescu at gmail.com> wrote: >>>>>>> >>>>>>>> Mike is right, we don't have CWD right now, as our only filesystem >>>>>>>> doesn't even support directories :) Have you tried "require >>>>>>>> /rom/filename.lua" directly? If it doesn't work, we probably need to take >>>>>>>> care of LUA_PATH and LUA_CPATH somehow, I don't even know what are their >>>>>>>> "default" values currently. >>>>>>>> >>>>>>>> best, >>>>>>>> Bogdan >>>>>>>> >>>>>>>> >>>>>>>> On Mon, Nov 24, 2008 at 10:37 PM, Mike Panetta < >>>>>>>> panetta.mike at gmail.com> wrote: >>>>>>>> >>>>>>>>> Why do you need to support ./ at all? I don't quite see how that >>>>>>>>> makes sense here. The only reason that would make sense is if you want to >>>>>>>>> execute a file from the current directory. If you just want to read a file >>>>>>>>> (as require does) you don't need the ./. Another reason it does not make >>>>>>>>> sense is, lua does not have a CWD set. >>>>>>>>> >>>>>>>>> Mike >>>>>>>>> >>>>>>>>> >>>>>>>>> On Mon, Nov 24, 2008 at 1:07 PM, Dado Sutter <dado at pobox.com>wrote: >>>>>>>>> >>>>>>>>>> Hello, >>>>>>>>>> Lua modules are fundamental and all we need eLua to do now is >>>>>>>>>> very simple. >>>>>>>>>> require() has to be able to "find" a file in it's search path >>>>>>>>>> strategy, which is long (we won't care about all the options) but begins by >>>>>>>>>> a simple ./filename. >>>>>>>>>> Our FS has to be able to recognize the ./filename (we include >>>>>>>>>> /rom/ in the filename) notation. >>>>>>>>>> Other option would be to mod Lua to search for /filename first >>>>>>>>>> (before ./filename) but that sounds harder and changes Lua. >>>>>>>>>> This is very important for us now, to create some interesting >>>>>>>>>> support modules (I can talk about them all here if wanted :). I can take a >>>>>>>>>> look and implement it myself, after hearing some hint from you :) >>>>>>>>>> Thanksssssss :) >>>>>>>>>> >>>>>>>>>> Best >>>>>>>>>> Dado >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Mon, Nov 24, 2008 at 12:29, Bogdan Marinescu < >>>>>>>>>> bogdan.marinescu at gmail.com> wrote: >>>>>>>>>> >>>>>>>>>>> Never tried that, and I'm not at all familiar with the modules >>>>>>>>>>> part, but we'll get the hang of it eventually. eLua doesn't have an >>>>>>>>>>> "environment", so I'm curious about the default values of the environment >>>>>>>>>>> variables relevant to the module subsystem. Will take a look. >>>>>>>>>>> >>>>>>>>>>> Best, >>>>>>>>>>> Bogdan >>>>>>>>>>> >>>>>>>>>>> On Mon, Nov 24, 2008 at 3:08 AM, Dado Sutter < >>>>>>>>>>> dadosutter at gmail.com> wrote: >>>>>>>>>>> >>>>>>>>>>>> Hello eLuers :) >>>>>>>>>>>> In our present rom File System, how can we require() a Lua >>>>>>>>>>>> module ? >>>>>>>>>>>> The problem seems to be with Lua's way of searching the >>>>>>>>>>>> possible paths to the module. >>>>>>>>>>>> The very first one should do but Lua gives me an File not >>>>>>>>>>>> Found error looking for ./rom/filename.lua (yes, the file is there :), >>>>>>>>>>>> probably because our fs doesn't recognize the ./ notation. >>>>>>>>>>>> Is there a way to solve it today ? >>>>>>>>>>>> >>>>>>>>>>>> Best >>>>>>>>>>>> Dado >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>> Elua-dev mailing list >>>>>>>>>>>> Elua-dev at lists.berlios.de >>>>>>>>>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> _______________________________________________ >>>>>>>>>> Elua-dev mailing list >>>>>>>>>> Elua-dev at lists.berlios.de >>>>>>>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Elua-dev mailing list >>>>>>>>> Elua-dev at lists.berlios.de >>>>>>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Elua-dev mailing list >>>>>>> Elua-dev at lists.berlios.de >>>>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>>>> >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Elua-dev mailing list >>>>>> Elua-dev at lists.berlios.de >>>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Elua-dev mailing list >>>>> Elua-dev at lists.berlios.de >>>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Elua-dev mailing list >>>> Elua-dev at lists.berlios.de >>>> https://lists.berlios.de/mailman/listinfo/elua-dev >>>> >>>> >>> >>> _______________________________________________ >>> Elua-dev mailing list >>> Elua-dev at lists.berlios.de >>> https://lists.berlios.de/mailman/listinfo/elua-dev >>> >>> >> > An HTML attachment was scrubbed... URL: https://lists.berlios.de/pipermail/elua-dev/attachments/20081125/57643744/attachment.html |
Free forum by Nabble | Edit this page |