Back

elixir - 2. 交互式界面 iex 和运行

发布时间: 2019-02-17 07:57:00

交互式:跟 irb 一样。

iex :

$ iex
Erlang/OTP 21 [erts-10.2.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]

Interactive Elixir (1.8.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> 1 + 1
2
iex(2)> "hi" <> "siwei"

运行:

新建一个文件  simple.exs ,内容:

IO.puts "hi from elixir"

运行:

$ elixir simple.exs

hi from elixir

注释: #, 

Back