Registers the name an assignment operator like nlmixr2save's := is
assigning to, which rxode2 uses when the model expression itself names
nothing (an anonymous model function) and when the expression is a call
without a rxModelName() method. It is not consumed when it is used, so
one assignment can name every model it builds; the operator that set it
clears it with rxModelNameLhs(NULL), which is what keeps the name from
leaking into an unrelated later model.
See also
Other Model names:
rxModelName(),
rxModelNameFromExpr()
Examples
# an assignment operator registers the name it is assigning to before it
# forces the model, and clears it afterward:
#
# `:=` <- function(x, value) {
# rxode2::rxModelNameLhs(as.character(substitute(x)))
# on.exit(rxode2::rxModelNameLhs(NULL))
# assign(as.character(substitute(x)), force(value), envir=parent.frame())
# }
rxModelNameLhs()
#> NULL
rxModelNameLhs("mod")
rxModelNameLhs()
#> [1] "mod"
rxModelNameLhs(NULL)
