Lourival Vieira Neto wrote: > On Tue, Dec 3, 2013 at 9:26 PM, Alexander Nasonov <al...@yandex.ru> wrote: > > Do you have a test to prove that 'return 2^3' doesn't break in the > > kernel? > > Yes; you can just load the script you've mentioned. There is no reason > to break anything. It is just defined as the multiplication operator.
Well, you can certainly do this or tweak something else in the language but you should stop calling your thing Lua. Because it's not Lua anymore. Recent discussion on lua-l about some tweak: http://marc.info/?l=lua-l&m=138494227416821&w=1 > >> Is there an issue with lua_error? > > > > I don't think that lua_error would work because lua_State isn't passed > > to luai_numpow(a,b). I wanted to say that you need a stub that breaks > > in a very noticeable way. > > I really miss your point here. Why lua_State should be passed to > luai_numpow()? Anyway, I just checked and lua_error is working fine. What do you mean by "working fine"? Are you talking about this change: #define luai_numpow(a,b) lua_error(L, "") ? It can't work because luai_numpow is used inside constfolding (defined in lcode.c) where L is undefined. Since you can't use lua_error, you may consider this #define luai_numpow(a,b) \ panic("I take this opportunity to say that I need " "a volunteer to implement luai_numpow in the kernel. ") ;-) But seriously, you can easily implement it. It doesn't even have to be in a Lua core file. You can create a new file in you lua module directory. > Do you have an example that breaks it? If you want a verbose output, > just push your error message (like, lua_pushstring(L, "my error")) and > call lua_error(L). If kern.lua.verbose is set, you will get "my error" > printed. You guys keep adding sysctls. Why do you need kern.lua.verbose? I assume that all kernel Lua code should have a protected call at top-level. If they don't, you definitely want to see an error printed to the console. Alex