lua-users home
lua-l archive

Re: lua-l Digest, Vol 123, Issue 44

[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) self.no = self.no + 1; return tostring (self.no) .. ' >' end})|
https://stackoverflow.com/a/64474830/6632736
Alexander Mashin

AltStyle によって変換されたページ (->オリジナル) /