[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: local-ity of undef parameter
- From: spir <denis.spir@...>
- Date: Tue, 8 Dec 2009 13:46:19 +0100
output = function(thing, level)
level = level or 1
if not level then level = 1
Is here 'level' local in the case it was not defined inthe calling expression? Or should I write:
local level = level or 1
if not level then local level = 1
to ensure its "local-ity"?
The point imo is, if level is undef, then there is no reason for an assignment to implicitely make it local -- except if the compiler deduces this quality from the fact that the name happens to be the same as the one of a parameter. Or do I miss the point?
la vita e estrany