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

How to add/send ancillary info from CallSites to Binders? #280

Open
clrudolphi opened this issue Jun 1, 2024 · 0 comments
Open

How to add/send ancillary info from CallSites to Binders? #280

clrudolphi opened this issue Jun 1, 2024 · 0 comments

Comments

@clrudolphi
Copy link

I am experimenting with the dlr by writing a toy language. I've based some of it on the examples given by the Sympl code in the dlr repo. I'm keeping it fairly simple - runtime objects are instances of a class derived from DynamicObject. Callable methods are also classes derived from DynamicObject (leveraging the TryGet/TrySet/TryInvoke features).

I would like to make source line number information available so that if something goes wrong and my runtime throws an exception, it can include the source line # in the error message.
I have used a custom field on my custom binders (deriving from GetMemberBinder, InvokeBinder, etc), but I suspect this is not the correct way to do it as that would prevent these binders from being re-used across call sites.

I had hoped that perhaps I could derive a custom class from CallInfo, but that is sealed.

How should/could this be done? Where might I find examples of something similar in another language's implementation on the dlr?
TIA

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