Any idea on Exception Handler？
havent found any error and exception handle method in docs。Any idea？
Errors are handled with option types:
There's no way to catch panics (exceptions), but there will be a way to recover, just like in Go.
There's no way to catch panics *yet*.
There should be a way to catch panics (exceptions), for remote logging and cleanup.
I'm concerned that being able to recover from a panic and continue running the program will both add complexity to the compiler as well as encourage using panics as exceptions - isn't panic/recover essentially just throw/catch? If V supports something like `defer` or better, struct destructors (so we can manage memory automatically) then panics will make code generation (and feature design) more complex.
For logging a panic or showing a dialog to the user, all that's needed is a callback function. Only being able to register a callback that is called on panic might make the compiler's job easier in the case of code that needs to run on scope exit.
That's a very good point, @ntrel.
recover() is often overused in Go.
There will be `defer` by the way.
Log in via GitHub to comment
, open-source blogging/forum software written in V