lua-users home
lua-l archive

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


Hi,

While working on the core API the realization dawned that up-values
can subvert static typing of local variables :-(

> function x() local i: integer; return function(j) i = j; end; end
> f=x()
> f(5)
> f('hello')

Haven't thought yet how to fix this:
a) Probably easiest to disallow referencing typed values in up-values
b) Alternatively up-values need to be typed ... not sure if that is
possible to enforce at compile time

Regards
Dibyendu