Closed timfennis closed 4 months ago
Hmm I'm noticing now that your PartialEq
for ObjKey
behaves differently from ParitalEq
for Obj
which is probably another reason why ObjKey
and Obj
are different.
Glad to hear about other people's languages!
Honestly I don't remember, I vaguely believe that I tried comparing and hashing pointers and was discouraged by some compiler warning, but I could be making this up. So I could be open to making functions hashable. But yeah I think Obj
probably shouldn't have total Ord
for example.
Thanks for the insights, if I find the time I'll try and draft up a PR soon.
Hi
You inspired me to read crafting interpreters and write my own programming language. Since rust is also my implementation language of choice I'm able to take plagiaristic amounts of inspiration from Noulith. Thanks I guess, hope you don't mind.
I was adding adding a Dictionary type myself and noticed that you wrap
Obj
inObjKey
to deal with instances ofObj
that seemingly can't be hashed easily. I was doing something similar but ended up implementingHash
forObj
and usedRc::as_ptr
to hash my function type. (I also implementedPartialEq
using the same pointer)Is this something you considered and rejected, if so, what was your reasoning? If not I would be down to create a PR that gets rid of
ObjKey
.