Skip to content

Commit dadcdbc

Browse files
committed
Add suggested doc changes.
1 parent f381fca commit dadcdbc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

R/property.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@
3232
#' The validator will be called after the `class` has been verified, so
3333
#' your code can assume that `value` has known type.
3434
#' @param default When an object is created and the property is not supplied,
35-
#' what should it default to? If `NULL`, defaults to the "empty" instance
36-
#' of `class`.
35+
#' what should it default to? If `NULL`, it defaults to the "empty" instance
36+
#' of `class`. This can also be a quoted call, which then becomes a standard
37+
#' function promise in the default constructor, evaluated at the time the
38+
#' object is constructed.
3739
#' @param name Property name, primarily used for error messages. Generally
3840
#' don't need to set this here, as it's more convenient to supply as a
3941
#' the element name when defining a list of properties. If both `name`
@@ -65,7 +67,8 @@
6567
#'
6668
#' # Because the property is dynamic, it is not included as an
6769
#' # argument to the default constructor
68-
#' "now" %in% names(formals(clock)) # FALSE
70+
#' try(clock(now = 10))
71+
#' args(clock)
6972
#'
7073
#' # These can be useful if you want to deprecate a property
7174
#' person <- new_class("person", properties = list(

0 commit comments

Comments
 (0)