Skip to content

Add quoted.Expr.block #6747

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

Merged
merged 1 commit into from
Jun 26, 2019

Conversation

nicolasstucki
Copy link
Contributor

This is a constructor for block expression that creates the block from a list of expression.
The other way to crreate blocks is by nesting blocks in a recursion which is prone stack overflows.

This is a constructor for block expression that creates the block from a list of expression.
The other way to crreate blocks is by nesting blocks in a recursion which is prone stack overflows.
Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

Otherwise, LGTM

import refl._
Block(statements.map(_.unseal), expr.unseal).seal.asInstanceOf[Expr[T]]
}

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems this can be done using toExprList and then use quote and splices?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Functionally it can but it would not solve the recursion issue. But actually I could use this one to improve toExprOfList

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By improve I mean not have a recursive implementation that nests all the trees creating an extremely deep tree.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I hit a bug trying to implement it. I will leave it for another PR.

@nicolasstucki nicolasstucki merged commit 646e433 into scala:master Jun 26, 2019
@nicolasstucki nicolasstucki deleted the add-quoted-expr-block branch June 26, 2019 15:43
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.

2 participants