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

Make LibXML::Item use :config for boxing #97

Merged
merged 1 commit into from
Feb 27, 2023

Conversation

vrurg
Copy link
Contributor

@vrurg vrurg commented Feb 27, 2023

Any config supplied by upstream was previously ignored and class mapping was expected to be done by LibXML::Node. This resulted in limited abilities of user code in controlling how boxing is done. See #94.

Note that LibXML::Node still does its own class mapping because this is the point of final decision and in many cases it is invoked directly.

Any config supplied by upstream was previously ignored and class mapping
was expected to be done by `LibXML::Node`. This resulted in limited
abilities of user code in controlling how boxing is done. See libxml-raku#94.

Note that `LibXML::Node` still does its own class mapping because this
is the point of final decision and in many cases it is invoked directly.
@vrurg
Copy link
Contributor Author

vrurg commented Feb 27, 2023

Following #94 and this comment in particular. For caching to work properly, i.e. for a LibXML::Node subclass to be able to intercept the box method, it is necessary that LibXML::Item.box calls that subclass' box instead of directly referring to LibXML::Node. This PR makes it possible.

An alternative would be to modify class mapping on the global configuration object and pointing it into a some kind of proxy-class which would then re-dispatch the call to an appropriate class, but that adds an extra call to the call chain.

@dwarring dwarring merged commit fb25e54 into libxml-raku:master Feb 27, 2023
dwarring pushed a commit that referenced this pull request Feb 27, 2023
Move the call to $.raw.set-flags to a TWEAK submethod as it needs to be
called after $.raw.Reference has been called.
Any config supplied by upstream was previously ignored and class mapping
was expected to be done by `LibXML::Node`. This resulted in limited
abilities of user code in controlling how boxing is done. See #94.

Note that `LibXML::Node` still does its own class mapping because this
is the point of final decision and in many cases it is invoked directly.
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