Erlang的第乙個程式

2021-06-21 12:19:06 字數 695 閱讀 5683

最近學習erlang,erlang的介紹就不多敘,本篇主要是介紹如何跑入門的第乙個「hello world」。

一,安裝erlang:

我所在的作業系統是windows,所以需要安裝個windows下的erlang 編譯環境。

直接安裝,安裝後設定路徑。

把bin (如 d:\erl5.9.1\bin)新增到系統變數的path後(右鍵我的電腦/屬性/高階/環境變數)。

檢查erlang是否安裝成功:

輸入erl看是否安裝成功。

在erlang的執行目錄下(可通過pwd()獲得執行路徑),建立乙個helloworld.erl檔案。內容如下:

-module(helloworld).

-export([say/0]).

say() ->

io:format("hello, world!\n").

把該檔案放在erlang的執行目錄下(通過pwd()可以檢視執行目錄),

然後輸入c(helloworld).

切記erlang的每個表示式是以.結束的。編譯成功

再輸入 helloworld:say().

可以看到神奇的hello,world!啦!

第乙個視窗程式

程式截圖 程式 include lresult callback wndproc hwnd,uint,wparam,lparam int winapi winmain hinstance hinstance,hinstance hprevinstance,pstr szcmdline,int icm...

第乙個popcap 程式

一 tips ddimage mmapimg ddimage 上f12,定位到ddimage.h,在vs2008 中ddimage.h tab標籤上alt o 定位到ddimage.cpp 二 vs2008 中c c code generation runtime library 設成multi t...

第乙個python 程式

有人在論壇 上問 將日誌格式化的方法,剛好學python,就拿這個練手了 09 55 54 error1 tmp error log.3 50 times mon jun 28 00 00 53 2009 09 55 54 error1 tmp error log.3 50 times 09 56 ...