Jack Daniel's
Jack Daniel's

Reputation: 2613

Elixir io_lib call to erlang

io_lib:fread("~d/~d/~d", "2013/03/03").

Above code works in erlang so ideally in elixir below code should work

:io_lib.fread("~d/~d/~d", "2013/03/03") 

but it generates error " no function clause matching "

After inspecting found that elixir makes call to module like

:io_lib_fread.fread("~d/~d/~d", "2013/03/03", 0, []) 

Upvotes: 1

Views: 383

Answers (1)

José Valim
José Valim

Reputation: 51429

A double quote in erlang "char list" translates to single quotes in Elixir 'char list'.

Upvotes: 5

Related Questions