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

Parsing: optimize reference of top-level bindings #35

Open
sfultong opened this issue Sep 20, 2018 · 1 comment
Open

Parsing: optimize reference of top-level bindings #35

sfultong opened this issue Sep 20, 2018 · 1 comment

Comments

@sfultong
Copy link
Owner

Currently top-level definitions are just copied directly into other definitions' ASTs.

Instead, top-level bindings should be encapsulated in an extra lambda which then has whatever definitions that binding relies on applied to it.

This technique should also be used for let bindings.

If it makes sense, also fix parsing so that declarations don't have to come before they are used, and make sure recursive definitions are disallowed.

@sfultong
Copy link
Owner Author

This issue is made trickier by polymorphism of top level bindings. We don't want to use a single binding site if the use is polymorphic, because that could cause type errors where otherwise there would be none.

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

No branches or pull requests

1 participant