iqis / Q7

Freestyle Object Oriented Programming in R
GNU General Public License v3.0
5 stars 1 forks source link

Make type portable #13

Open iqis opened 3 years ago

iqis commented 3 years ago

Use portable() to attach package scope to class's parent env chain.

myThing <- portable(type(function(a, b){
                add <- function() a + b
}))
## or 
myOtherThing <-  function(){
             value <- 1
           } %>%
          type() %>% 
          portable()