Consider the following code:
a = function() { return (23) } b = function() { return (23) * 23 } c = function() { return (23) * someUndefinedVariable }
All of the above succeeds (if called) and return 23. I assumed that R ignores everything that happens after the return closing parenthesis, but this is actually not the case because this code does not work when loading the code:
d = function() { return (23) something }
My assumption is that in the last example, some lexers or parsers fail. But in the first expression it is parsed as (return(23))*some (because return treated as a function), but the evaluation stops at return , and therefore R does not try to find some .
Does this sound normal? This is the reason? Is this behavior expected? Can I include some warnings so that the interpreter tells me about such “inaccessible code”?
r
yeputons
source share