Fork me on GitHub
#specter
<
2018-02-13
>
johanatan22:02:01

hi, if i'm transform over [specter/MAP-VALS :some-key] and inside my transform i want/need to access the KEY-VAL corresponding to the particular MAP-VAL that i'm in, is that possible? or do these cases always degenerate into a case of [specter/ALL] with drilling down required inside the transform-fn

nathanmarz23:02:02

@johanatan accessing the key while transforming a map val is expressed as (transform [ALL (collect-one FIRST) LAST] ...)

johanatan23:02:28

ah, nice. what would be the signature be for capturing the key and the value?

johanatan23:02:35

just [[k v]] ?

johanatan23:02:06

[the transform-fn signature that is]

johanatan23:02:16

and also can you have additional filters (such as the kwd in my example) after the LAST ?