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, destructuring hashes, closes #47 #151

Merged
merged 3 commits into from Feb 2, 2019
Merged

Conversation

odino
Copy link
Collaborator

@odino odino commented Jan 31, 2019

myhash = {"some": "thing", "over": "the rainbow", "x": "y"}
some, over = myhash
echo(some) # "thing"

@ntwrick I had to revert one of your changes we introduced
when adding error lines etc. When we evaluate null literals
we always return a new object, and this means that when
you compare null == null that is false as they're 2
different objects. For now I reverted that line you changed
but maybe we could also think of adding a special case to
handle == with nulls. Problem is, you'd have to add another
special case for != so I think it's probably easier to just
reuse the same object for nulls...what do you think?

```
myhash = {"some": "thing", "over": "the rainbow", "x": "y"}
some, over = myhash
echo(some) # "thing"
```

@ntwrick I had to revert one of your changes we introduced
when adding error lines etc. When we evaluate null literals
we always return a new object, and this means that when
you compare `null == null` that is `false` as they're 2
different objects. For now I reverted that line you changed
but maybe we could also think of adding a special case to
handle `==` with nulls. Problem is, you'd have to add another
special case for `!=` so I think it's probably easier to just
reuse the same object for nulls...what do you think?
@odino odino added the enhancement New feature or request label Jan 31, 2019
@odino odino added this to the 1.1.x milestone Jan 31, 2019
@odino odino requested a review from ntwrick January 31, 2019 22:30
@odino
Copy link
Collaborator Author

odino commented Jan 31, 2019

@ntwrick if you think it might be worth it I can probably backport the fix for null comparisons to 1.0.2, wdyt?

@odino odino mentioned this pull request Jan 31, 2019
@odino odino self-assigned this Jan 31, 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.

I see the *ast.NullLiteral case change. Looks good.

BTW, I can review as time permits, but being retired I'm not always immediately available. I don't want to get on your critical path and hold you up. So please proceed as you see fit.

@odino
Copy link
Collaborator Author

odino commented Feb 1, 2019 via email

@odino odino merged commit d16a8d7 into 1.1.x Feb 2, 2019
@odino odino deleted the destructuring-hashes branch February 24, 2019 05:48
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.

None yet

2 participants