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

iter() doesnt works/exists #41

Open
darltrash opened this issue Dec 15, 2020 · 1 comment
Open

iter() doesnt works/exists #41

darltrash opened this issue Dec 15, 2020 · 1 comment

Comments

@darltrash
Copy link

As said in the title. iter() doesnt works.

conte := ["undertale", "underale"]
for x in iter(conte) {
    std print(conte)
}

Returns:

wrong: can't seem to find `iter`
     --> ./definitions.wu
      │
   32 │ for x in iter(conte) {
      │          ^^^^
@nilq
Copy link
Member

nilq commented Dec 15, 2020

Thank you for opening an issue!

Having something like an iter iterator would be great. Currently there are ipairs and pairs, like in vanilla Lua:

list := [1, 2, 3, 3]

for x, y in ipairs(list) {
    print(x, y)
}

I won't close the issue, and will implement iter ASAP. Also, you don't need to use std print; just referencing print will do the job.

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