Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

io.lines not properly implemented #977

Closed
SoniEx2 opened this issue Mar 28, 2015 · 6 comments
Closed

io.lines not properly implemented #977

SoniEx2 opened this issue Mar 28, 2015 · 6 comments

Comments

@SoniEx2
Copy link
Contributor

SoniEx2 commented Mar 28, 2015

io.lines(nil, ...) doesn't work as it should

@fnuecke
Copy link
Member

fnuecke commented Mar 29, 2015

What does it do, what do you expect it to do?

@SoniEx2
Copy link
Contributor Author

SoniEx2 commented Mar 29, 2015

It calls io.input():lines(), I expected it to call io.input():lines(...)

@fnuecke
Copy link
Member

fnuecke commented Mar 29, 2015

The Lua manual doesn't really mention this use-case, it does say however:

The call io.lines() (with no file name) is equivalent to io.input():lines()

Is the manual wrong / incomplete? Does it actually behave the way you want it to in vanilla Lua?

@SoniEx2
Copy link
Contributor Author

SoniEx2 commented Mar 29, 2015

Well I found the OC bug while porting Lua 5.2's IO lib (the C code) to LuaJIT/FFI

@fnuecke
Copy link
Member

fnuecke commented Apr 11, 2015

If it behaves different to "vanilla" Lua, feel free to make a pull request to change it, with an example use-case and way to reproduce the discrepancy. Since it's basically undocumented behavior, I don't really think it's critical, though.

@fnuecke fnuecke closed this as completed Apr 11, 2015
@SoniEx2
Copy link
Contributor Author

SoniEx2 commented Apr 11, 2015

Well you could say

The call io.lines() (with no file name) is equivalent to io.input():lines() (Emphasis mine)

Would allow io.lines(nil) to be equivalent to io.input():lines(), thus io.lines(nil, ...) should be equivalent to io.input():lines(...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants