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 think I found a bug yesterday while using specter. When navigating into map entries, I noticed that you can call Clojure's key on it while in a select, but not when in a transform/multi-transform/set-val. My understanding (and the error I got) is that a MapEntry is kept as is in a select, but is transformed into a PersistentVector while in a transform.
Below a complete reproduction of the bug, and also a show case of what I was trying to do (navigating to map entries where the key isn't some specific key):
This is happening because small maps (PersistentArrayMap) store the keys and values in a single array, and the all-transform is operating on entries as two-item vectors (here).
I suspect there may be some way to reassign key to first when evaluating this anonymous function (only when the structure is a PersistentArrayMap, i.e. using the protocol mechanism).
For now, though, it seems that using MAP-KEYS with a predicate does what you want.
Hello, long time no issue :)
I think I found a bug yesterday while using specter. When navigating into map entries, I noticed that you can call Clojure's
key
on it while in aselect
, but not when in atransform
/multi-transform
/set-val
. My understanding (and the error I got) is that a MapEntry is kept as is in a select, but is transformed into a PersistentVector while in a transform.Below a complete reproduction of the bug, and also a show case of what I was trying to do (navigating to map entries where the key isn't some specific key):
Bug? To be clear, for me the bug is that MapEntry are transformed to Vector whereas I expected them to be MapEntry.
End of report!
The text was updated successfully, but these errors were encountered: