[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Limited dostring()?
- From: Edgar Toernig <froese@...>
- Date: Fri, 11 Jan 2002 04:10:55 +0100
Luiz Henrique de Figueiredo wrote:
>
> Here is a version of require that works in 4.0:
>
> do
> local A={}
> function require(x)
> if %A[x]==nil then %A[x]=1; return %dofile(x) end
> end
> end
Btw, what do you think about a slight modification that detects
dependency loops? (I do that in Sol.)
if A[x]==nil then
A[x]=1
...dofile...
A[x]=2
return results...
elseif A[x]==1 then
error("dependency loop")
end
Ciao, ET.