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

Allow to iterate over hashes, closes #139 #153

Merged
merged 2 commits into from
Feb 2, 2019
Merged

Conversation

odino
Copy link
Collaborator

@odino odino commented Feb 1, 2019

for k, v in {"a": 1, "b": 2, "c": 3} {
  echo(k, v)
}

This required a bit of refactoring on the iterables,
but nothing too crazy. I like how in this new implementation we check whether we're done iterating when the key is nil, rather than when it's < 0 which is wonky.

```
for k, v in {"a": 1, "b": 2, "c": 3} {
  echo(k, v)
}
```

This required a bit of a refactoring on the iterables,
but nothing too crazy.
@odino odino added the enhancement New feature or request label Feb 1, 2019
@odino odino added this to the 1.1.x milestone Feb 1, 2019
@odino odino requested a review from ntwrick February 1, 2019 13:21
@odino odino self-assigned this Feb 1, 2019
Copy link
Contributor

@ntwrick ntwrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very useful expression.

In file for.md, the example on line 66 would be more consistent with line 79 if it were for v in {...} instead of for x in {...} since you are iterating over the values.

@odino odino merged commit 05a235a into 1.1.x Feb 2, 2019
@odino odino deleted the make-hashes-iterable branch February 24, 2019 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants