LoginSignup
0
0

More than 5 years have passed since last update.

変数・アトム_「すごいErlangゆかいに学ぼう!」_#02

Posted at

変数

One = 1. %% 1が変数Oneに代入された
One = 2. %% エラー。代入は一度まで
One = 1. %% 左辺の代入済の値と右辺の値が同じなら、スルーしてくれる
54 = 53 + 1. %% 証拠にこちらもスルー
54 = 54 + 1. %% エラー
two = 2. %% エラー。Erlangでは変数は大文字で始まる。小文字から始まるものはアトム。

アトム

atom. %% atomというアトム
atom_boy. %% アンダーバー使える
atom@example. %% @も使えるのね
atom = 'atom'. %% エラー起こらない。等価とみなすようだ
atom = "atom". %% エラー
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0