Skip to content

Instantly share code, notes, and snippets.

@imranismail
Created April 8, 2016 15:26
Show Gist options
  • Save imranismail/3ca6501adc0fc60c277998768bde75cc to your computer and use it in GitHub Desktop.
Save imranismail/3ca6501adc0fc60c277998768bde75cc to your computer and use it in GitHub Desktop.
Dynamic Function Capture

Normally we would capture using the & syntax eg: &List.first/1 if we know exactly what to capture. How would I capture the function if the module name and function name is stored in a variable example:

module_name = List
function = :size
arity = 2

Now how would I capture the function dynamically?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment