我有myerlib/src/myerlib.erl erlang库模块,我需要从Elixir模块调用它的函数.从elixir代码调用myerlib模块函数我可以写:myerlib.function(.....)但是
如果我将myerlib子目录放在deps/elixir目录下并使用mix.exs:
def deps do
[
{:myerlib, path: "deps/myerlib"}
# ...
]
end
Run Code Online (Sandbox Code Playgroud)
然后,当我这样做时,iex -S mix我收到此错误:
***(混合):路径选项只能用于混合项目,无效的路径依赖关系:myerlib
一大早和Erlang一起玩我得到了一个奇怪的结果:
-module(bucle01).
-compile(export_all).
for(N) when N >=0 ->
lists:seq(1,N).
for(L,N) when L =< N ->
lists:seq(L,N);
for(L,N) when L > N ->
lists:reverse(for(N,L)).
Run Code Online (Sandbox Code Playgroud)
当我运行程序时,我看到了这个:
> bucle01:for(1,10).
[1,2,3,4,5,6,7,8,9,10]
> bucle01:for(10,1).
[10,9,8,7,6,5,4,3,2,1]
>bucle01:for(7,10).
[7,8,9,10]
>bucle01:for(8,10).
"\b\t\n" %% What's that !?!
>bucle01:for(10,8).
"\n\t\b" %% After all it has some logic !
Run Code Online (Sandbox Code Playgroud)
任何"Kool-Aid"到"不要喝太多"请?