lua-users home
lua-l archive

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


----- Original Message -----
From: "Edgar Toernig" <froese@gmx.de>
To: "Multiple recipients of list" <lua-l@tecgraf.puc-rio.br>
Sent: Tuesday, May 16, 2000 2:36 AM
Subject: Re: precompiling


> function dofile(name)
>   local cname = name .. ".luac"
>   if not exist(cname) or isolder(cname,name) then
>     compile_and_dump(name,cname)
>   end
>   dofile(cname)
> end
>
> It's doable but I don't know if anybody has made it.

This is what uCore does behind the scenes. When I do a dofile it checks for
the existense of both source and binary (They are both located in a
database) and if only the binary exists it executed, if the both exists and
the binary is newest then thats executed otherwise the source is compiled
and stored in the database (and then the binary is executed)

/Erik