문제

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, []) 
도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top