The proposal utilizes V's function result returns for the wrapping of the C functions that return a boolean that resembles if the function was successfully called.
E.g. a function that might fail, could handle the error simpler and would have to ignore it explicitly.
Current:
// Handle error example:
// Show the window, panic on fail
if !w.show(doc) {
panic('The browser(s) was failed')
}
// Ignore error:
// Without using the bool return it isn't clear that the function could fail.
w.show()
Proposed:
/// Handle error example:
// Show the window, panic on fail
w.show(doc) or { panic(err) }
// Ignore error:
w.show(doc) or {}
I think this is a more V native way to handle functions that can fail and would endorse error handling by default and better safety.
The proposal utilizes V's function result returns for the wrapping of the C functions that return a boolean that resembles if the function was successfully called.
E.g. a function that might fail, could handle the error simpler and would have to ignore it explicitly.
Current:
Proposed:
I think this is a more V native way to handle functions that can fail and would endorse error handling by default and better safety.