ChinaUnix.net
相关文章推荐:

Erlang 程序设计 电子书

Recipe 534162: An erlang Port in Python erlang has two built-in interoperability mechanisms. One is distributed erlang nodes and the other one is ports. Ports provide the basic erlang mechanism for communication with the external world. They provide a byte-oriented interface to an external program. When a port has been created, erlang can communicate with it by sending and receiving lists of...

by pascal4123 - Erlang - 2009-07-23 00:55:18 阅读(2094) 回复(0)

相关讨论

erlang下的io:format 换行打印"~n" io:format("你好~n世界"). 字符替换"~w" 直接替换,"~-15w"代表输出15个字符,不够的空格补 io:format("~-15w ~w", [test1, test2]). erlang下的列表数组与递归调用 erlang的“数组” 假设 [E1, E2 | R] = [1,2,3,4,5,6,7]. %注意其中的"|",带有分割的意思 结果 E1=1 E2=2 R=[3,4,5,6,7] 根据此判断字符长度: -module(tut). -export([len/1]). len([]) ->0; ...

by bs - Erlang - 2016-04-23 15:10:26 阅读(2951) 回复(3)

现在云计算开始流行了,建议CU开一个erlang板块 谢谢!

by lei8c8 - Erlang - 2009-01-17 12:20:46 阅读(2036) 回复(4)

Data = Req:parse_post(), Uid = list_to_binary(proplists:get_value("uid", Data)), %调试打印出来的是74 Uid2 = put(74,111), Topid = get(Uid), %undefined Topid2 = get(74), %输出111 为什么Topid = get(Uid), %undefined 这句得不到111呢??

by kakashilw - Erlang - 2009-09-02 19:08:47 阅读(5330) 回复(2)

[code] -module(echo). -export([start/0, loop/0,while/2]). start() -> spawn(echo, loop, []). loop() -> receive {From, Message} -> From ! Message, while(Message,10), loop() end. while(M,0)-> {over,M}; while(M,Count)-> io:format("this outputs for: ~w~n", [M]), while(M,Count-1). [/code] 并发运行: Id = echo:start(),Id2 = echo:start(). Id ! {self(), h...

by erlangs - Erlang - 2009-04-15 15:09:22 阅读(3125) 回复(2)

以前我们用python做的一个演示产品, 以python -m CGIHTTPServer启动服务器后, cgi-bin 目录下的脚本文件根据程序员的喜好, 可以用python, scala开发: python脚本要加个 #!/usr/bin/python scala脚本要加个 #!/bin/sh exec scala "$0" "$@" !# 那能否用erlang开发CGI脚本呢? 答案是肯定的,因为eralng提供了escrip可以直接运行erlang代码. 用如下代码测试时, python却报CGI script exit status 0x7f00 ?! #!/usr/local/bin/...

by sw2wolf - Erlang - 2008-12-24 08:58:05 阅读(6530) 回复(10)

-module(hello). -export([hello_world/0]). hello_world()-> io:format("Hello World ~n"). ----------------------------------------------------------------------- And Executing: hello:hello_world().

by r2007 - Erlang - 2016-04-23 15:12:40 阅读(6683) 回复(13)

[quote]What's all this fuss about erlang? 原文: http://www.pragprog.com/articles/erlang 作者: Joe Armstrong 译者:许式伟 朱照远 没人可以预言未来,但我却打算做一些有依据的推测。 让我们假设 Intel 是正确的,而且 Keifer 项目会获得成功。如果是这样,那么 32 核的处理器在 2009/2010 年就将会出现在市场上。 这毫不奇怪, Sun 已经制造出了 Niagara ,它拥有 8 个核,每个核运行 4 个超线程(这相当于 32 个核)。...

by flw - Erlang - 2009-07-02 16:24:40 阅读(7014) 回复(8)

下载源码: svn checkout http://erlang-mysql-driver.googlecode.com/svn/trunk/ erlang-mysql-driver-read-only 下载完后命名目录为"mysql",进入mysql/src目录对其下的文件全部进行编译; 建立mysql/ebin目录,把编译好的.beam文件拷贝到ebin中 复制mysql目录到erlang/lib目录下。 启动erlang sehll环境 #erl 连接mysql: 1>mysql:start_link(p1, "localhost", "root", "password", "test"). mysql_conn:620: greeting vers...

by bs - Erlang - 2014-11-28 17:20:01 阅读(12846) 回复(5)

到这边下载erlydtl: http://code.google.com/p/erlydtl/ 解压后拷贝 erlydtl 目录到 erlang/lib 底下,然后 $ make $ erl -make 既安装完成。 任意目录下创建以下文件 创建文件:test.erl [code] -module(test). -export([run/0]). run()-> erlydtl:compile("tpl.htm", welcome_template), welcome_template:render([ {name, "Johnny"} ]). [/code] 创建模板文件 tpl.htm [code] Welcome back, {{...

by bs - Erlang - 2014-11-28 17:18:21 阅读(5960) 回复(3)

函数式编程中,如erlang的列表,获取某个特定元素的值只能采用线性查找吗? 有无类似的键值?

by bs - Erlang - 2009-04-24 13:34:06 阅读(3177) 回复(8)