ボム君.com

Masa's blog

今まで学んできたITスキルを主に。

Erlang

Programming: Parallel VS Concurrency

In functional programming, such as Erlang and Haskell could be better suited for answering question of what are the differences between Parallel and Concurrency programming. According to "Parallel and Concurrent Programming in Haskell", In…

Erlang: If-else

Very simple usage of If-Else Statement in Erlang Language -module(what_the_if). -export([heh_fine/0, oh_god/1, help_me/1]). %% should check if this actually works (hint: an error will be thrown) heh_fine() -> if 1 =:= 1 -> works end, if 1 …

Erlang: 簡単なサーバーとクライアントのメッセージプログラム

Erlangプログラミングではよく使う二つ以上の間でのメッセージ交換。 主に並行処理で必要不可欠の基礎ポイントをここで。 その簡単な例を作ってみた。 まずモジュールの名前をexample -module(example). 関数を定義する。ここでは三つの関数を使うので三つと…

Erlang: exception error: no match of right hand side典型的なミス

Erlang は他のプログラミングと違い変数の作りかたと値を入れるやり方が違う。 変数名は全部最初は大文字から Xxxx = 1. Yyyy = 2. 変数に値をあげるのは一度きり %エラー Xxxx = 2. 他の関数で値を変えてもダメ f(Y) -> Y = 5. %エラー main() -> X = 3, f(…