2007/05/08

erlang その6

ファイル名に.を含めてみる。
<ets.tut1.erl>

-module(ets.tut1).
-export([test/0]).
test()->io:format("~p~n", ["test"]).

これをコンパイルしてみると、
1> c(ets.tut1).
** Module name ''ets.tut1'' does not match file name ''ets.tut1'' **
{error,badfile}

となる。また試しに ' でくくってみた。
2> c('ets.tut1').
** 2: syntax error before: c **

やはりエラー。
どうやらファイル名を . を含めると正常に処理できないようだ。
リファレンスマニュアルによると
<引用>
The name Module, an atom, should be the same as the file name minus the extension erl.
</引用>
である。また、atomには . を含んでもよい。
このことから、ファイル名の途中に . を含めることができそうにみえるが、できないようだ。
マニュアルのどこかに別途この点について記載がされているのかもしれない…

0 件のコメント :