lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Side note, as this is often missed by newcomers: instead of

   require "..\\a\\a.lua"
will get a error can not find a.lua

but use
   dofile("..\\a\\a.lua")
will ok

you can use either forward slashes as it is well supported by the Windows API:

require "../a/a.lua"
dofile  "../a/a.lua"

and is more portable, or if you prefer to keep the Windows look (or just easier to copy/paste these paths), just use long format of literal strings:

require [[..\a\a.lua]]
dofile  [[..\a\a.lua]]

I always found these doubled anti-slashes quite ugly/unreadable. It is particularly aggravating for regular expressions in Java (making stuff not particularly readable totally obscure!) which doesn't have such facilities...

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --