4 ms·
> Maps are provided as sets of pairs Does it mean this can be a map? {(k1, v1), (k1, v2)}
by perfunctory 12y ago
> Maps are provided as sets of pairs
Does it mean this can be a map?
{(k1, v1), (k1, v2)}
- GregBuchholz 12y agoI think you have to use square brackets... stuff := {['k1','v1'],['k2','v2'],['k2','v3']}; print (stuff('k1')); print (stuff{'k2'});
- perfunctory 12y agoWhat I meant is that it sounds like it's possible to have two entries in a map with the same key.
- GregBuchholz 12y agoYes, they are multi-maps, and can have multiple values for the same key. In that case you have to use curly brackets to deference, and you'll get a set back with the values.