lua-users home
lua-l archive

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

Good day one and all. I was wondering if anyone had had any thoughts about treating Lua code as an object so that you can play with it and use it interactively. I think this was mentioned a while ago but nor followed up?
Off the top of my head... I was thinking of having a Lua class called "_Code". You make an instance of this and instead of using dofile() you call _Code:dofile() for things you want to keep, edit, recompile and save. When you use _Code:dofile(), it reads your file, parses it and executes it. The class remembers the source code of the code executed and if you want to edit something you can go to _Code and retrieve it. You then edit it and return it to _Code which executes it and can save it for you. _Code could also supply you with a table containing all the editable stuff available. Ergo, you have code editing mungojiggery. This could perhaps be a wrapper for the debug interface?
Any thoughts please?

Clothes make the man. Naked people have little or no influence on society.
Mark Twain (1835 - 1910)