lua-users home
lua-l archive

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


On Mon, Jul 4, 2011 at 22:41, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
>> This way of removing functions might not be ideal:
>>
>>   [...]
>>   > setfenv(function()end, {})
>>   stdin:1: deprecated function
>>   stack traceback:
>>       [C]: in function 'setfenv'
>>       stdin:1: in main chunk
>>       [C]: in ?
>>
>> The reason is that to test whether a function exists, it is not as simple as
>>
>>   if io.popen then ..... end
>>
>> [...]
>
> On the other hand, I guess this message may be very useful for people
> changing from 5.1 to 5.2. (Not people from the list, who has been
> discussing the changes for a long time, but many (most?) programmers
> not aware of all changes...)
>
> -- Roberto
>
>

That functionality would better be implemented as a small library that
would be loaded only during the porting effort.

-- Pierre-Yves