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

evaluators.js: allow transform.rewrite() to change endowments #38

Merged
merged 2 commits into from
Aug 29, 2019

Conversation

michaelfig
Copy link
Member

This reordering of the transforms phasing makes it possible for a
rewriter to affect the actual endowments.

I found I need this in order to implement the import() expression transform correctly: it is a source-dependent endowment that can't easily be defined before the rewrite transform takes place without terrible hacks.

This reordering of the transforms phasing makes it possible for a
rewriter to affect the actual endowments.
@michaelfig michaelfig requested review from warner and erights August 29, 2019 01:50
Copy link
Member

@erights erights left a comment

Choose a reason for hiding this comment

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

Does rs stand for "rewriter state"? Does a rewriter state now consist of { src, endowments }? If so, transform.rewrite(rs) now transforms such a rewriter state, meaning it can transform src and endowments together, yes?

If so, why is there still a transform.endow? Why is there still the reduce on line 98 of evaluators.js ?

src/evaluators.js Outdated Show resolved Hide resolved
@michaelfig
Copy link
Member Author

Does rs stand for "rewriter state"? Does a rewriter state now consist of { src, endowments }? If so, transform.rewrite(rs) now transforms such a rewriter state, meaning it can transform src and endowments together, yes?

Correct.

If so, why is there still a transform.endow? Why is there still the reduce on line 98 of evaluators.js ?

I was hesitant to make a breaking change, but I will happily remove transform.endow support in the name of simplification.

@michaelfig michaelfig requested a review from erights August 29, 2019 17:10
Copy link
Member

@erights erights left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@warner warner left a comment

Choose a reason for hiding this comment

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

yep, sounds reasonable to me too

@michaelfig michaelfig merged commit 01b8558 into master Aug 29, 2019
@michaelfig michaelfig deleted the transform-rewrite-endowments branch August 29, 2019 19:55
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