design icon indicating copy to clipboard operation
design copied to clipboard

Use delayed binding to create expensive functions

Open hadley opened this issue 5 years ago • 2 comments

Because they're run once

Use for backports etc

hadley avatar Feb 17 '20 20:02 hadley

There isn't really enough detail here for me to be sure what you are talking about. But if it is delayedAssign() this is such a rarely needed technique I am not sure it is worth addressing in a general design document...

jimhester avatar Mar 02 '20 16:03 jimhester

I was thinking specifically for packages, instead of initialising to NULL and then rebinding inside of .onLoad()

hadley avatar Mar 02 '20 17:03 hadley

We now also have rlang::on_load(), so I no longer think we need this issue.

hadley avatar Jul 20 '23 19:07 hadley