Closed jenzopr closed 6 years ago
I am not sure I understand exactly what you need:
has_function
, to perform checks on the interface?Is type
important for you example? Is the following useful for you?
m <- modules::module({
boringFunction <- function() "boring output"
})
hasFunction <- function(m, name) {
exists(name, m, mode = "function")
}
hasFunction(m, "boringFunction")
hasFunction(m, "foo")
I needed the checks on the interface, correct!
Thanks a lot!
You're welcome.
-s
Hi!
I wonder if it possible to assert if a module exports a function and/or variable with a certain name?
E.g. I would like to do:
Best and thank you for a quick hint! Jens