Can an active binding access its own name during function call?


I am down a rabbit hole and doing some off-label coding.

Can an active binding made with makeActiveBinding() or rlang::env_bind_active() access the name of the active binding during the function call?

For makeActiveBinding(sym, fun, env) this would correspond to accessing sym when calling fun, and for rlang::env_bind_active(env, sym = fun) this would correspond to the RHS fun accessing the LHS sym.

In other words, if I made an active binding like:

makeActiveBinding('name_of_binding', function() ..., globalenv())

Is there a way to access 'name_of_binding' when the function is called?

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.