Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't see a reason why the compiler couldn't implement error-sum return values the same way that exceptions are typically implemented (the way you describe).

(I don't see why it should, either. The blanket "efficiency" argument is unconvincing to me).

Ok, I see one reason: The programmer might want control which implementation is used. That would require an additional mini-feature in the language syntax/function types. But this still wouldn't be an argument for a whole different syntax and forced separate code paths as required for traditional exceptions. And it's theoretic anyway -- I don't think it's important to give the user this "control".



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: