일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- Linux
- programming_book
- hadoop
- France
- RFID
- agile
- Programming
- Book
- Malaysia
- QT
- ubuntu
- management
- Spain
- erlang
- Kuala Lumpur
- Python
- psychology
- comic agile
- Software Engineering
- program
- hbase
- django
- Book review
- leadership
- Italy
- history
- essay
- Java
- web
- MySQL
- Today
- Total
www.erlang.org - quick start 본문
http://www.erlang.org/faq/quick_start.html
Starting erlang |
If you are running a unix system type "erl"
or, if you are running on windows-95 or NT start Erlang by clicking on the
Erlang start icon. You should see something like this:
유닉스 시스템을 사용한다면, “erl”을 입력하거나, 윈도우를 사용한다면, Erlang 시작 아이콘을
클릭해 Erlang을 시작한다. 다음과 같은 것을 볼 수 있을 것이다:
$ erl Erlang (BEAM) emulator version 5.6.3 [source] [async-threads:0]
[kernel-poll:false] Eshell V5.6.3
(abort with ^G) 1> |
The ">" prompt means the system is
waiting for input.
“>” 프롬프트는 시스템이 입력을 기다리고 있다는 것을 의미한다.
Using Erlang as a
calculator |
1> 2131836812671*12937192739173917823. 27579983733990928813319999135233 |
Remember to terminate every expression with a DOT
followed by a whitespace!
모든 식을 마치기 위해서는 뒤에 공백이 따라오는 점이 있어야 한다는 것을 기억하라!
Editing previous
expressions |
Previous expressions can be retrieved and edited using
simple emacs line editing commands. The most common of these are:
앞선 식들은 단순한 이맥스 라인 편집 명령을 이용해 검색되거나 편집될 수 있다. 가장 흔하게 사용되는
것들은 다음과 같다:
- ^P fetch
the previous line.
- ^N fetch
the next line.
- ^A Go to
the beginning of the current line.
- ^E Go to
the end of the current line.
- ^D Delete
the character under the cursor.
- ^F Go forward
by one character.
- ^B Go Back
by one character.
- Return Evaluate the current command.
- ^P는 전 행을 가져온다
- ^N은 다음 행을 가져온다
- ^A는 현재 행의 처음으로 간다
- ^E는 현재 행의 끝으로 간다
- ^D는 현재 커서가 있는 글자를 지운다
- ^F는 한 글자 다음으로 간다
- ^B는 한 글자 앞으로 간다
- Return은 현재 명령을 수행한다
Note: ^X means press Control + X
^X는 Control + X를 누르는 것을 의미한다
Try typing Control+P to see what happens.
무엇이 발생하는지 보려면 Control + P를 입력해보라.
Compiling your
first program |
Type the following into a file using your favorite
text editor:
-module(test). -export([fac/1]). fac(0) -> 1; fac(N) -> N * fac(N-1). |
Store this in a file called test.erl The
file name must be the same as the module name.
test.erl이라는 파일로 저장한다. 파일 이름은 모듈 이름과 같아야 한다.
Compile the program by typing c(test) then run it:
c(test)를 입력해 프로그램을 컴파일하고 실행한다:
3> c(test). {ok,test} 30> test:fac(20). 2432902008176640000 4> test:fac(40). 815915283247897734345611269596115894272000000000 5> |
Now go and write some games!