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

Hook environment for lookups #153

Closed
wants to merge 3 commits into from
Closed

Conversation

lionel-
Copy link
Member

@lionel- lionel- commented May 23, 2017

Includes #152

  • Implements a hook environment as an object table. Requires some trickery to instantiate an environment and set the hashtable to the object table. This environment signals a typed condition when it gets requests for an object.

  • Instruments tidyeval overscopes with the hook environment so we get conditions for lookup failures. The hook environment is installed at the end of the lexical scope.

Not as successful as I'd hoped:

  • As we discussed grabbing a function is not a distinct operation on object tables, so we can't signal different conditions for symbol lookup and function lookup.

  • R often does not call the exists() method but uses get() and checks for R_UnboundValue. In particular it does this when looking up for S3 methods. This means we signal a lot of false positive conditions :(

@hadley
Copy link
Member

hadley commented May 23, 2017

Maybe the hook env will be more effective if it knows its parent so it can proxy the calls and we can attach it higher up - that should avoid the spurious S3 stuff.

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