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

Fix ||= and &&= definitions #2914

Closed
wants to merge 1 commit into from
Closed

Fix ||= and &&= definitions #2914

wants to merge 1 commit into from

Conversation

0joshuaolson1
Copy link

No parentheses necessary, right?

@jhass
Copy link
Member

jhass commented Jun 25, 2016

Please don't edit any .html files on the gh-pages branch. In this case edit https://github.com/crystal-lang/crystal/blob/gh-pages/_gitbook/syntax_and_semantics/assignment.md

@bcardiff
Copy link
Member

@0joshuaolson1 beside what jhass comment, there is no issue in the documentation of how ||= and &&= works.

You can find de definition in https://github.com/crystal-lang/crystal/blob/master/src/compiler/crystal/syntax/parser.cr#L430

Expanding var || (var = expr) avoid the extra assignment w.r.t. var = var || expr.

@bcardiff bcardiff closed this Jun 25, 2016
@0joshuaolson1 0joshuaolson1 deleted the patch-1 branch June 25, 2016 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants