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

Why do identifier properties and compile-time values require explicitly capturing a lookup procedure? #749

Open
dpk opened this issue Nov 3, 2023 · 0 comments
Labels

Comments

@dpk
Copy link

dpk commented Nov 3, 2023

The Chez Scheme implementation of identifier properties and the more limited compile-time values requires the transformer to return a procedure which the expander in turn re-enters with a lookup (rho) procedure to find the compile-time value or the property value. Any helper procedure used by a transformer which has to look up this information has to be passed this procedure explicitly as well.

Meanwhile, the equivalent for compile-time values in Racket, syntax-local-value can simply be imported into a library. Guile has a similar feature, syntax-local-binding. Both are restricted to being called within macro transformers for obvious reasons.

Other than the fact that lookup/rho cannot be used outside a transformer call, and depends on state made available by the expander (which could be done using a parameter or some other dynamic state, for example), is there any reason for the design decision to require explicitly capturing the lookup procedure to access compile-time values and properties, rather than making an identifier-property-ref type procedure which can be in scope anywhere?

(I tried to add the label ‘question’ but couldn’t see how.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants