Yes, as follows:
def my_function([head | tail] = list) do
# use whichever part you want
end
// gonz
On Mon, May 16, 2016 at 02:25:24AM -0700, hdcos wrote:
> Hello there :),
>
> is it possible to do something like this:
>
> def my_function([hd | tail] as my_list) do
> #use my_list hd and tail
> end
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-talk" 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-talk/6cdde1fa-29e8-45c6-8566-00636061558f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"elixir-lang-talk" 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-talk/20160516093532.GE13818%40omniknight.
For more options, visit https://groups.google.com/d/optout.