deprecated_binding_old: Create an Active Binding that Generates a Deprecation Warning

View source: R/warn_deprecated.R

deprecated_binding_oldR Documentation

Create an Active Binding that Generates a Deprecation Warning

Description

Creates an active binding that generates a warning when accessed, using warn_deprecated_old(). The active binding will otherwise be read-only.

Usage

deprecated_binding_old(what, value)

Arguments

what

(character(1))
A description of the deprecated binding. Should be of the form "Class$field".

value

(any)
The value of the active binding. This should be an expression that will be evaluated in the context of the active binding. It could, for example, refer to self.

Examples

MyClass = R6::R6Class("MyClass", public = list(),
  active = list(
    foo = deprecated_binding_old("MyClass$foo", "bar")
  )
)
mco = MyClass$new()
mco$foo

mlr3 documentation built on June 11, 2026, 5:08 p.m.