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

Add return as a special form #1380

Merged
merged 2 commits into from
Aug 19, 2017
Merged

Add return as a special form #1380

merged 2 commits into from
Aug 19, 2017

Conversation

Kodiologist
Copy link
Member

@Kodiologist Kodiologist commented Aug 11, 2017

Closes #739.

To do:

  • Documentation
  • NEWS

hy/compiler.py Outdated
value = None
ret = Result()
if len(expr) > 1:
value = self.compile(expr[1])
Copy link
Contributor

Choose a reason for hiding this comment

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

Slightly bikeshedding, but here value is switching types which is kinda confusing. Usually in the compiler code, this would just be something like:

compiled_expr = self.compile(expr[1])
ret += compiled_expr
value = compiled_expr.force_expr

or maybe another name still.

Copy link
Member Author

Choose a reason for hiding this comment

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

I just realized that I can get rid of one of the assignments, because ret.force_expr works, so I did that.

@Kodiologist
Copy link
Member Author

@kirbyfan64 How's that?

@tuturto tuturto merged commit b99460b into hylang:master Aug 19, 2017
@Kodiologist
Copy link
Member Author

Whoops, I hadn't written the NEWS item or documentation yet. I probably should've done that after the first approval. I'll do it in a new PR.

@Kodiologist Kodiologist deleted the return branch August 27, 2017 21:32
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

Successfully merging this pull request may close these issues.

3 participants