Zulip Chat Archive
Stream: lean4
Topic: Vector Repr instance
Wrenna Robson (Dec 12 2024 at 16:23):
Would it be possible to change the Repr instance for Vector? It is currently the default one, which isn't very useful - it just prints the array along with useless stuff. It would be more useful to have it in the form #v[3, 4, 5]
, say.
Wrenna Robson (Dec 12 2024 at 16:31):
I would make the change myself, but I think Vector is now defined in core along with its Repr instance, so I'm a bit scared about touching it!
Wrenna Robson (Dec 12 2024 at 16:32):
(It seems like the procedure for core is that I need to create an RFC?)
Shreyas Srinivas (Dec 12 2024 at 16:43):
I think you can make a batteries PR
Shreyas Srinivas (Dec 12 2024 at 16:43):
Then core can take it when they want to.
Shreyas Srinivas (Dec 12 2024 at 16:43):
CC : @François G. Dorais
Wrenna Robson (Dec 12 2024 at 16:44):
Right, but as core already has a Repr instance (it auto-derives it), won't it clash if it's in batteries?
Shreyas Srinivas (Dec 12 2024 at 16:45):
Oh right
Wrenna Robson (Dec 12 2024 at 16:46):
What would be useful is core simply removing the Repr auto-derivation and then we work on the alternative in batteries. But still requires a change to core! I don't understand why they imported the default one.
Shreyas Srinivas (Dec 12 2024 at 16:47):
That little fiasco might be my fault since I didn't create a proper Repr instance, and then it got upstreamed. But I also recall that #eval wasn't using unexpanders back then
Wrenna Robson (Dec 12 2024 at 16:48):
I am afraid I don't know what an unexpander is :)
Edward van de Meent (Dec 12 2024 at 21:07):
there is a small paragraph about it in the metaprogramming book
Last updated: May 02 2025 at 03:31 UTC