ヽ(´・肉・`)ノログ

How do we fighting without fighting?

すごいE本をElixirでやる

Learn you some Erlang for great good!の日本語翻訳Web版が Erlang の OTP を知るのにとても良かった.

それに加筆,修正されてすごいErlangゆかいに学ぼう! ( 通称:すごい E 本 ) として出版されたので買った.

Elixir は Erlang のライブラリを全て利用できるので,すごい E 本を Elixir におきかえて学んでみる.

1章

1.1 Erlang シェルを使ってみる

Erlang の erl 相当のものは Elixir だと iex だ.

Erlang の help().h() だな.

Ctrl+G を押してから h は Erlang と同じようだ.これ知らなかったなあ. フリーズしたら Ctrl+G i Enter c Enter と押せばいいことを知った.へー.

/Users/niku% iex
Erlang/OTP 17 [erts-6.1] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Interactive Elixir (0.14.3) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> h()

                                  IEx.Helpers

Welcome to Interactive Elixir. You are currently seeing the documentation for
the module IEx.Helpers which provides many helpers to make Elixir's shell more
joyful to work with.

This message was triggered by invoking the helper h(), usually referred to as
h/0 (since it expects 0 arguments).

There are many other helpers available:

• c/2       — compiles a file at the given path
• cd/1      — changes the current directory
• clear/0   — clears the screen
• flush/0   — flushes all messages sent to the shell
• h/0       — prints this help message
• h/1       — prints help for the given module, function or macro
• l/1       — loads the given module's beam code and purges the current version
• ls/0      — lists the contents of the current directory
• ls/1      — lists the contents of the specified directory
• pwd/0     — prints the current working directory
• r/1       — recompiles and reloads the given module's source file
• respawn/0 — respawns the current shell
• s/1       — prints spec information
• t/1       — prints type information
• v/0       — prints the history of commands evaluated in the session
• v/1       — retrieves the nth value from the history
• import_file/1             — evaluates the given file in the shell's context

Help for functions in this module can be consulted directly from the command
line, as an example, try:

┃ h(c/2)

You can also retrieve the documentation for any module or function. Try these:

┃ h(Enum)
┃ h(Enum.reverse/1)

To learn more about IEx as a whole, just type h(IEx).
このエントリーをはてなブックマークに追加