[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Sanity check..
- From: Ando Sonenblick <ando@...>
- Date: Fri, 01 Aug 2003 17:48:33 -0700
Sounds, good and I agree, extensions are better than modifications.
So if I register a C routine named print, it'll override the built in?
>> I've done pretty much the same thing as Ando, except that I added accessor
>> functions to the API to prevent the base library from needing access to the
>> lua_State internals.
> I really think the best way is to copy luaB_print and change it to your needs
> and then register this as "print". No need mess with the internals of Lua.
> Plus your code will work in any version of Lua. I mean, you won't have to add
> your changes every time a new version of Lua comes out. Bottom line: write Lua
> libraries to extend Lua, if possible -- try to avoid changing the core of Lua.