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

print-method on nested objects doesn't get triggered correctly #731

Closed
borkdude opened this issue May 14, 2022 · 1 comment
Closed

print-method on nested objects doesn't get triggered correctly #731

borkdude opened this issue May 14, 2022 · 1 comment

Comments

@borkdude
Copy link
Collaborator

borkdude commented May 14, 2022

Consider:

$ bbm1 -e "(deftype Foo [x]) (defmethod print-method Foo [x writer] (print-method (.-x x) writer)) (prn (->Foo 1))"
1

but:

$ bbm1 -e "(deftype Foo [x]) (defmethod print-method Foo [x writer] (print-method (.-x x) writer)) (prn [(->Foo 1)])"
[#user.Foo{:x 1}]

Perhaps we will have to find another way to implement print-method, e.g. define a print-method for sci.impl.records.SciRecord which dynamically dispatches to a print-function that is registered via our internal print-method.

One such point could be in the multi-fn-add-method-impl which we could pass the context.

@borkdude
Copy link
Collaborator Author

Relates to #726

borkdude added a commit that referenced this issue May 15, 2022
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