Use binary ?
operator as try-else
#52
Labels
meta-proposal
Language proposals
theme-internals
Relates to internal operations of the language
type-enhancement
New feature or request
R's error propagation is already quite powerful! All expressions are evaluated as though they can fail, and their errors are reported up through the call stack.
However, R's error capture and recovery is a bit messier. Instead of throwing errors, many codebases resort to returning
NULL
or some other value of significance to indicate an error, which can be interpreted as a special case by the calling function. This seems to be a pattern that has arisen out of the clunky error handling.Perhaps we can make code both more readable and more stable by introducing better error handling features:
The R world has no shortage of infix operators floating around, so deciding to reuse the binary infix behavior of a symbol should be done cautiously to make the best use of the syntax.
The text was updated successfully, but these errors were encountered: