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
let updateOrAdd key value (dict : dict<'Key, 'T>) =
// Preconditions
checkNonNull "dict" dict
if dict.IsReadOnly then
invalidOp "Cannot update or add an entry to a read-only dictionary."
lock dict <| fun () ->
dict.[key] <- value
dict
The text was updated successfully, but these errors were encountered:
Hmm. There might have been a good reason for it at one point, but I don't remember now.
If I had to guess, it may be because returning the dictionary instance makes the function signatures more like those in the Map module.
Whatever the reason was before, the inconsistency seems like a code smell now so I'll keep this open as a work item for the first major ExtCore release (v1.0). There's no ETA for that release but I do have a few other small, breaking changes to make to other parts of the library at some point so it'd be best to group them all together.
Any reason these operations dont return dict, while the non-Safe do?
https://github.com/jack-pappas/ExtCore/blob/master/ExtCore/Collections.Dict.fs#L331-L337
Why not:
The text was updated successfully, but these errors were encountered: