Skip to contents

Clone an Instance

Usage

# S3 method for Q7instance
clone(inst, deep = TRUE, ...)

Arguments

inst

Q7 object instance

deep

to copy nested object instances recursively; Boolean

...

dot-dot-dot

Value

Q7 object instance

Examples


Type1 <- type(function(num){
  print_num <- function(){
    base::print(num)
  }
})
myType1 <- Type1(1)
myType1$print_num()
#> [1] 1
myType1_clone <- clone(myType1)
myType1_clone$print_num()
#> [1] 1