4 ms·
That sounds like asking for trouble. Someone coming from any other programming language could easily forget that expression evaluation is stateful. Better to
by broomcorn 3y ago
That sounds like asking for trouble. Someone coming from any other programming language could easily forget that expression evaluation is stateful. Better to be explicit and create an object representing a expression. Tell me, at least, that the variable is immutable in that context?
- nerdponx 3y agoThe whole magic is that expressions are in fact just objects in the language. And no, there aren't any immutable bindings here.
- vharuck 3y agoIt's crazy how literally R takes "Everything's an object." While parentheses can be treated like syntax when writing code, it's actually a function named `(`. Of course, playing with magic sounds fun until you remember you're trying to tell a computer to do a specific set of steps. Then magic looks more like a curse.
- bnprks 3y agoThe good news is that most variables in R are immutable with copy-on-write semantics. Therefore, most of the time everything here will be side-effect-free and any weird editing of the variable bindings is confined to within the function. (The cases that would have side effects are very uncommonly used in my experience)