Skip to content
Prev 61489 / 63424 Next

WISH: Optional mechanism preventing var <<- value from assigning non-existing variable

I have to say <<- is a core debugging tool when assigning into the global
environment. I suppose I could use assign but that would be somewhat
annoying.

That said I'm still for this change, the vast overwhelming number of times
that <<- is in my package code - already rare but it does happen - it would
absolutely be a bug (typo most likely) for it to get to the global
environment and assign into it. Assigning into thr global environment from
package code is a serious anti pattern anyway.

To be honest from the developer perspective what id personally actually
want is an assigner that was willing to go up exactly one frame from the
current one to find its binding. That is how I essentially always am using
<<- myself.

~G
On Sun, Mar 19, 2023, 11:16 AM Bill Dunlap <williamwdunlap at gmail.com> wrote: