Add support for *print-meta*#741
Conversation
| } | ||
| else | ||
| { | ||
| visit_object([&](auto const typed_o) { buff(typed_o->to_code_string()); }, o); |
There was a problem hiding this comment.
I wonder if to_code_string should have an overload that also accepts a buffer?
| auto const value{ visit_object([](auto const typed_o) { return typed_o->to_code_string(); }, | ||
| o) }; | ||
| buff(value); | ||
| auto const print_meta(make_box<obj::symbol>("clojure.core", "*print-meta*")); |
There was a problem hiding this comment.
These two to_code_string functions are no longer actually needed. We now have a to_code_string on the object. In fact, we don't even need to visit the object anymore to be able to get that, since it's now a virtual function.
So these global to_code_string functions should be considered deprecated. The vast majority of the time, when we do to_code_string, we will NOT be using these functions. So we need to handle this differently. Perhaps we will need to handle this in each object's to_code_string function.
There was a problem hiding this comment.
In looking through some of the method implementations for to_code_string, I found a few that reference these functions, such as range.cpp. Should those functions be updated to call the method instead?
There was a problem hiding this comment.
Yeah, we ultimately just want to remove those old uses entirely. jank is in a transitional state between the closed object model and the open object model right now. visit, as well, is the old way of doing things, but we need to build out the virtual fns on object more in order to replace it.
No description provided.