You can simply pass the function in that use case.

f = fn x -> x*2 end
Enum.map([1,1,1], f)


On Friday, August 17, 2018 at 12:19:31 PM UTC+2, Jakub G wrote:
>
> It is possible to add support for using local defined functions in 
> ampersand notation?
>
> Example:
> f = fn x -> x*2 end 
> Enum.map([1,1,1], &f/1)
>
> It would really simplify those 
> &f.(&1) 
> calls, especially with functions passed as function arguments.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/4bb83bfa-fd4d-4d6a-99ff-7dd72af60382%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to