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

Create a record and pass that around in the rewrite rules. #41

Merged
merged 1 commit into from
Dec 27, 2012

Conversation

pjonsson
Copy link
Member

This is the basic necessary infrastructure for performing conditional rewrites.

basic necessary infrastructure for performing conditional rewrites.
@pjonsson
Copy link
Member Author

I'm not sure what you have in mind. Somewhere someone has to know about the targets, and this is a nice first order representation. I guess you could define each target as a list of rewrite rules and conditionally apply them, but that makes it harder to debug since you're passing opaque functions around.

I'm not particularly attached to the current solution so if you want to change it go ahead. It's just one implementation of making a record and passing it around to the rewrite rules like Emil suggested in some other ticket. It might also be possible to change the contents of the record without changing much else if that was what you had in mind.

@emwap
Copy link
Member

emwap commented Dec 27, 2012

Lets go with your solution for now.

emwap added a commit that referenced this pull request Dec 27, 2012
Create a record and pass that around in the rewrite rules.
@emwap emwap merged commit aa76456 into Feldspar:master Dec 27, 2012
@emilaxelsson
Copy link
Member

I agree that we shouldn't let details of the back ends leak into the language package. It should be possible to add a back end (including conditional rewrites) without recompiling the language package.

I've created issue #45 to fix this.

(Anyway, this is a good step forward!)

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.

None yet

3 participants