lua-users home
lua-l archive

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


On Thu, Jan 31, 2013 at 03:30:05PM +0200, Bezobiuk Volodymyr wrote:
> [vbezobiuk@vbezobiuk ~]$ lua5.1
> Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> > setmetatable(_G,{__index=function(...)print(...)end})
> table: 0x10476b0    _PROMPT
> 
> here it is. lua cli requests the global variable _PROMPT :) and os.getenv
> needs string as it's first argument
> the prompt is not set by default (that's why __index got triggered)
> probably you wanted something like:

Oh, I know the code's nonsense.  What surprised me is why the REPL bails
out.  On #lua, we're theorising that lua.c does not wrap its lookup of
_PROMPT in a pcall or similar.

B.