Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: