Erlang已经安装:
$dpkg -l|grep erlang
ii erlang 1:13.b.3-dfsg-2ubuntu2 Concurrent, real-time, distributed function
ii erlang-appmon 1:13.b.3-dfsg-2ubuntu2 Erlang/OTP application monitor
ii erlang-asn1 1:13.b.3-dfsg-2ubuntu2 Erlang/OTP modules for ASN.1 support
ii erlang-base 1:13.b.3-dfsg-2ubuntu2 Erlang/OTP virtual machine and base applica
ii erlang-common-test 1:13.b.3-dfsg-2ubuntu2 Erlang/OTP application for automated testin
ii erlang-debugger 1:13.b.3-dfsg-2ubuntu2 Erlang/OTP application for debugging and te
ii erlang-dev 1:13.b.3-dfsg-2ubuntu2 Erlang/OTP development libraries and header
[... many more]Erlang似乎起作用了:
$ erl
Erlang R13B03 (erts-5.7.4) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.7.4 (abort with ^G)
1> 我从github下载了lfe并查看了0.5.2:
git clone http://github.com/rvirding/lfe.git
cd lfe
git checkout -b local0.5.2 e207eb2cad
$ configure
configure: command not found
$ make
mkdir -p ebin
erlc -I include -o ebin -W0 -Ddebug +debug_info src/*.erl
#erl -I -pa ebin -noshell -eval -noshell -run edoc file src/leex.erl -run init stop
#erl -I -pa ebin -noshell -eval -noshell -run edoc_run application "'Leex'" '"."' '[no_packages]'
#mv src/*.html doc/一定是我错过了什么愚蠢的东西:
$ sudo make install
make: *** No rule to make target `install'. Stop.
$ erl -noshell -noinput -s lfe_boot start
{"init terminating in do_boot",{undef,[{lfe_boot,start,[]},{init,start_it,1},{init,start_em,1}]}}
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()有没有一个我如何创建hello world源文件并编译和运行它的例子?
发布于 2010-05-15 03:03:58
不,你什么都没错过。LFE中的Makefile“不够完美”,应该被忽略,它将在下一个版本中得到改进。为了弥补这一点,所有需要的文件都已经编译好了,并且ebin目录中有.beam文件。因为它不是OTP的一部分,所以我不认为它应该安装在那里。
处理此问题的最简单方法是创建一个私有的erlang库目录,并将环境变量ERL_LIBS指向该目录。然后只需将整个LFE目录放在那里。当erlang启动时,代码服务器会自动将lfe/ebin目录添加到路径中,并且会自动找到并加载路径中的.beam文件。这将适用于任何包含ebin目录的包。这也适用于Windows。所以:
创建一个libs目录,假设环境变量为~/erlang/lib
当您启动erlang时,您将在代码路径(code:get_path())中看到/Users/rv/erlang/lib/lfe/ebin (或任何地方)。然后,您还可以使用以下命令直接启动LFE shell
erl -noshell -noinput -s lfe_boot start将来还会有一个lfe和一个lfe.bat来做这件事。
与erlang一样,任何文本编辑器都可以编辑LFE。对于emacs,有一个LFE模式,它仍然是相当基本的,但工作正常。您还不能在窗口中运行LFE。很快就会。包含此内容的最佳方法是将以下内容放入.emacs文件中:
;; LFE mode.
(setq load-path (cons "/Users/rv/erlang/lib/lfe/emacs" load-path))
(require 'lfe-start)在lfe/examples中有一些示例文件,所有文件都应该可以工作。在lfe/test/visual中有一堆我的测试文件,它们已经作为示例文件包含了进来。从普通的erlang shell编译LFE文件
lfe_comp:file("foo").
l(foo). %No autloload here, do this to ensure loading而从LFE shell执行以下操作:
(c '"foo") ;This will autoloadlfe/docs中有一堆文档,这是非常准确的,但是user_guide.txt需要扩展。还有一个谷歌的LFE小组,网址是:
http://groups.google.se/group/lisp-flavoured-erlang它包含了一些有趣的讨论,人们在github LFE维基上写了很多东西。
我想就是这么回事。如果您有更多的问题,请联系我。
https://stackoverflow.com/questions/2835942
复制相似问题