Fork me on GitHub
#meander
<
2021-01-26
>
nlessa17:01:06

Hi! I have a map with a key that is a 6 elements vector. The difference between the keys is that they must differ in the first two elements of the vector. I tried this to match :

{[?eid1 ?eid2 ?eid3 ?eid4 ?eid5 ?eid6] ?val1,
 [(me/not ?eid1) (me/not ?eid2) ?eid3 ?eid4 ?eid5 ?eid6] ?val2}
but getting a map patterns may not contain variables in their keys that would make it so there is more than one match possible. How could I expresse this?

noprompt17:01:38

@nlessa The error happens when you use match so you’ll want to switch to find. match doesn’t allow for ambiguity and a map with a variable key is ambiguous thus the message.

💯 3
noprompt17:01:06

If you want an error, add the clause

_ (throw (ex-info "..." {,,,})
below the one you have above.

metal 3
nlessa17:01:40

Thanks, Joel @U06MDAPTP!

👍 3