3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

草莽Erlang ── 29. lists:all

Last updated at Posted at 2023-01-18

口で言うより行うことがErlang習得への近道と信じています。

lists:all/2

 リストの要素に対して適用する真偽値を返す関数を渡します。 リストの全体がtrueと評価されればtrue、そうでなければfalseが返されます。

> Words = ["foo", "bar", "hello"].

> lists:all(fun(S) -> string:length(S) == 3 end, Words).
false

> lists:all(fun(S) -> string:length(S) > 1 end, Words).
true

listsモジュールには他にもリスト処理のための関数がたくさんあります。

Elixirにも挑戦したい

闘魂ElixirシリーズとElixir Schoolがオススメです。

3
1
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
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?