lua-users home
lua-l archive

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

Dear all,

Why doesn't interactive Lua takes into account the __tostring metamethod of the non-string _PROMPT global when it prints the prompt, so that the below code does not help to increment the prompt on any typed command, although on any >=_PROMPT the variable is incremented?

|>_PROMPT = {no = 0}; setmetatable (_PROMPT, {__tostring = function (self) = + 1; return tostring ( .. ' >' end})|

Alexander Mashin