lua-users home
lua-l archive

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

2015-02-28 18:37 GMT+02:00 Nagaev Boris <>:

> if"*n") returns nil (a string can't be converted into a
> number), then all subsequent calls to"*n") return nil without
> reading the standard input.
> Example:
> $ lua5.2
> Lua 5.2.1  Copyright (C) 1994-2012, PUC-Rio
>> print('*n'))
> qwerty
> nil
>> print('*n'))
> nil
> Is it a bug?
> Calling "repairs""*n"), i.e. the next call to
>"*n") reads the standard input.

Since"*n") is unsuccessful, the pointer in the buffer
has not advanced. Therefore the next"*n") finds the
buffer in exactly the same state, and achieves the same