Elixir io_lib call to erlang

拥有回忆 提交于 2019-12-11 05:05:15

问题


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, []) 

回答1:


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



来源:https://stackoverflow.com/questions/18756293/elixir-io-lib-call-to-erlang

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!