[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: how io.read() will return nil ?
- From: lee <leeyacn@...>
- Date: Sun, 24 Aug 2008 21:08:35 +0800
在 Sun, 24 Aug 2008 19:00:52 +0800，Shmuel Zeigerman <firstname.lastname@example.org>
Jeff Pohlmeyer wrote:
I think you want to test for empty string, that is not the same as nil.
Empty string in Lua usually isn't considered as "no value", it is just
one of all the possible strings.
In Windows, the end of input is Ctrl-Z, in Linux - Ctrl-D (not sure in
Yes, you are right. In Linux, Ctrl-D results in the end of input, that is,
io.read() will return nil.
Finally, Thanks for all response!
As we know, there are known knowns. There are things we know we know. We
also know there are known unknowns. That is to say we know there are some
things we do not know. But there are also unknown unknowns, the ones we
don't know we don't know.