Are there other ways to wrap up functions in anonymous functions, e.g.
task = Task.async(fn -> do_some_work() end)
i.e. do we have options other than
fn -> ... end
I am doing this at the mo, prob not the best (but at least it’s not a macro)
def f(f), do:
fn -> f end
1 Like
arkgil
2
You can pass functions as arguments using this syntax:
&ModuleName.function/arity
or &function/arity
EDIT:
Applies also to function to variable assignment, i.e:
fun = &function/arity
1 Like
You have to wrap it again (iirc).
This is closer to the problem I am having.
Late here, I am prob not thinking about this properly right now : ) Will think again in the morning.