lua-users home
lua-l archive

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


Roberto wrote:
>>>
- standard libraries: standard libraries now use "namespaces". So,
strfind now is str.find, sin is math.sin, fileopen is io.open. Some
basic functions (type, assert, error, etc.) are still global. We also
changed the io library; e.g. files act as objects (f = io.open(...);
f:read(...); f:write(...)).
<<<

I come back to this already old message.
I saw reactions on the length of the standard namespace names (too short),
but none about the compatibility with old code.

Perhaps I missed something, or compability isn't a concern: I feel that the
motto is "Lua must improve, legacy shouldn't be an hinderance", a philosophy
I approve as it avoids monsters like the Win32 API :-)
But I have some scripts around doing some file manipulations, a generic CGI
engine, etc.

So if compatibility with old code is broken, do you think it would be easy
to upgrade old code, either by adding a line including a compatibility layer,
or a Lua program parsing Lua code to replace the obsolete calls (not just a
gsub, to avoid changing strings)?
Or perhaps a special switch for Lua executable, to add the old names to the
list of functions?

Regards.

-- 
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--

GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net