You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to store data associated with an expression. Unfortunately Expression doesn't implement Hash which makes it impossible for me to store the data inside a HashMap. Would it be possible to derive or implement Hash for Expression so an expression can be used as a HashMap key?
The text was updated successfully, but these errors were encountered:
Associating arbitrary data to arbitrary nodes is indeed something commonly useful. It's useful to store comments, lines of code, transformation data, etc.
One solution would be to have all nodes carry on a unique integer or a Rc::Weak<Any>. Or to parameterize all nodes by a payload type T.
Is this something that could be done in the near future? I'd be happy to, but I don't know how. So if someone could give me some pointers into the right direction, then I'd be happy to work on it.
I'm trying to store data associated with an expression. Unfortunately
Expression
doesn't implement Hash which makes it impossible for me to store the data inside aHashMap
. Would it be possible to derive or implementHash
forExpression
so an expression can be used as aHashMap
key?The text was updated successfully, but these errors were encountered: