Skip to content

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

@clrudolphi

Description

@clrudolphi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions