lua-users home
lua-l archive

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


On Monday, 4 July 2011, Pierre-Yves Gérardy <pygy79@gmail.com> wrote:
&gt; On Mon, Jul 4, 2011 at 22:41, Roberto Ierusalimschy
&gt; &lt;roberto@inf.puc-rio.br&gt; wrote:
&gt;&gt;&gt; This way of removing functions might not be ideal:
&gt;&gt;&gt;
&gt;&gt;&gt;   [...]
&gt;&gt;&gt;   &gt; setfenv(function()end, {})
&gt;&gt;&gt;   stdin:1: deprecated function
&gt;&gt;&gt;   stack traceback:
&gt;&gt;&gt;       [C]: in function 'setfenv'
&gt;&gt;&gt;       stdin:1: in main chunk
&gt;&gt;&gt;       [C]: in ?
&gt;&gt;&gt;
&gt;&gt;&gt; The reason is that to test whether a function exists, it
is not as simple as
&gt;&gt;&gt;
&gt;&gt;&gt;   if io.popen then ..... end
&gt;&gt;&gt;
&gt;&gt;&gt; [...]
&gt;&gt;
&gt;&gt; On the other hand, I guess this message may be very useful for people
&gt;&gt; changing from 5.1 to 5.2. (Not people from the list, who has been
&gt;&gt; discussing the changes for a long time, but many (most?) programmers
&gt;&gt; not aware of all changes...)
&gt;&gt;
&gt;&gt; -- Roberto
&gt;&gt;
&gt;&gt;
&gt;
&gt; That functionality would better be implemented as a small library that
&gt; would be loaded only during the porting effort.
&gt;
&gt; -- Pierre-Yves
&gt;
&gt;

+1