2 ms·
- Re: exceptions and implicity? I'm not sure how you define "implicitly" You have to declare that your function can propagate an error but otherwise do not ha
by spooneybarger 8y ago
- Re: exceptions and implicity?
I'm not sure how you define "implicitly"
You have to declare that your function can propagate an error but otherwise do not have to handle in the function for example
primitive Foo
fun propagates_an_error(x: U32, y: U32): U32 ? =>
x/?y
Will propagate the error you can get from y being 0.
The ? in the return signature is required to indicate that an error can happen.
- Re: assertions. We'll you can certainly do what you want when you know that haveing None from T or None is a bug. There is no "crash the actor" and start over in Pony. But it would be interesting to see what people came up with for patterns to "reset actor state"