Passing Around And Using Modules
A module is a bag of functions. When we define a module, we are tying it to an atom. If we pass around the atom that references this module, then we can use it to call its functions.
For example, consider two types of greetings:
And a generic greeting module that accepts a language module:
The module reference that we pass in to Greeting.say_hello
can be used to invoke the get_greeting
function.
Last updated