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
The most intuitive way to get the array of values from an AbstractDictionary is collect(dict). However, it always allocates, even if values are readily available, as in Dictionary.values.
I would like to propose creating a function that returns dict.values if it's present (eg Dictionary), and does collect(dict) otherwise (eg PairDictionary). Not sure what it's name should be, though. It's like collect, but possibly without a copy.
The text was updated successfully, but these errors were encountered:
Maybe the semantics could be convert(Vector, dict)? I've also come across situations where I have wanted this functionality (though in many way Dictionary acts like a Vector but with more general indexing so in general it seems like this could be avoided with generic programming).
The most intuitive way to get the array of values from an
AbstractDictionary
iscollect(dict)
. However, it always allocates, even if values are readily available, as inDictionary.values
.I would like to propose creating a function that returns
dict.values
if it's present (egDictionary
), and doescollect(dict)
otherwise (egPairDictionary
). Not sure what it's name should be, though. It's likecollect
, but possibly without a copy.The text was updated successfully, but these errors were encountered: