Skip to content

Add make_immutability decorator #2

Description

@harell
Car <- function(model = NA_character_, hp = NA_real_) return(
   data.frame(modek = model, hp = hp)
)


Car <- make_immutability(Car, freez = True)
car <- Car(model = "Mercedes-Benz S-Class", hp = 180)
car$hp <- 200 # fails because object is immutable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions