I don't think I get it:
So, the first two calls to a() return 0, and the last one aborts? (no "huh?" message after it.) But, without the try-finally, they would all abort. (well, okay, the first would abort and the others wouldn't be reached. sheesh, it's tough being a pedant, sometimes.) This seems to be intentional, but it also seems very strange to me, because I can't simply add try-finally to protect some code that needs to temporarily change some Mafia settings, without having to also rework the functional decomposition of my code. Is that right?
Code:
int a() {
try {
abort("abort! abort!");
} finally {
print("finally");
}
return 5;
}
int b() {
if (5==a()) print("five");
int foo = a();
print(foo);
a();
print("huh?");
return 6;
}
void main() {
b();
}
Code:
> whm_temp
abort! abort!
finally
abort! abort!
finally
0
abort! abort!
finally
So, the first two calls to a() return 0, and the last one aborts? (no "huh?" message after it.) But, without the try-finally, they would all abort. (well, okay, the first would abort and the others wouldn't be reached. sheesh, it's tough being a pedant, sometimes.) This seems to be intentional, but it also seems very strange to me, because I can't simply add try-finally to protect some code that needs to temporarily change some Mafia settings, without having to also rework the functional decomposition of my code. Is that right?