[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Thursday afternoon teaser
- From: Rob Kendrick <rjek@...>
- Date: Thu, 31 Jan 2013 13:32:57 +0000
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.