Failabiity of map/weak map mutation

Hi,

The documentation at Adding and Modifying Elements in a Map helpfully shows the syntax for changing a value in a map or adding a new value. It also explains that these expressions can fail, and so must be in a failure context.

What is the scenario for adding an element to a map to fail? I’m asking both on general knowledge, but also from the perspective of what failure handling would be appropriate on insertion failure.

1 Like

It’s because of some random technical constraint related to nested property mutating, see Ask Epic: Verse - March 28 @ 10:00 AM ET - #119 by UltimateLambda

1 Like

Thank you, that is just what I was looking for - I also see your comment further down that thread, little chuckle from me because “out of memory” and “concurrency” were two cases I was guessing at when trying to intuit the cause of this failure.

(Just conversationally, I am new to verse so I maybe am misunderstanding the syntax, but it seems a little funny to me for that to be a run-time error. I would have expected it to be a compilation error that the struct is not fully assigned, if that is a requirement.)

1 Like

Verse is still very immature, we’re only testers at this stage, so yeah some things don’t make sense, given that they’re doing a very different language, but it has great features too

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.