m1 <- module({
foo <- function() "foo"
})
m2 <- module({
bar <- function() "bar"
})
# Now we create a module with 'foo' and 'bar' as member functions.
m3 <- module({
expose(m1)
expose(m2)
})
m3$foo()
m3$bar()
Run the code above in your browser using DataLab