Thanks for the explanation. Yes, your second example is something like what I found in R code I was asked to modify.
What I find distasteful is that when calling mean(), the resolution of this name depends NOT on whether the local variable mean has been defined, but whether it has been assigned a function. This is illustrated by your 2nd and 3rd examples.
Of course if you are used to it, it may not catch you by surprise.
What I find distasteful is that when calling mean(), the resolution of this name depends NOT on whether the local variable mean has been defined, but whether it has been assigned a function. This is illustrated by your 2nd and 3rd examples.
Of course if you are used to it, it may not catch you by surprise.