1

I am getting unexpected output on running an anonymous function.

I have tried running it in iex and in an .exs file but getting the same response in both.

iex(1)> pair_tuple_to_list = fn {a,b} -> [a,b] end
#Function<6.128620087/1 in :erl_eval.expr/5>
iex(2)> pair_tuple_to_list.({8,7})
'\b\a'

I expected to get [8,7] but the output I am getting is '\b\a'

tac
  • 209
  • 2
  • 13

0 Answers0