misoca / reading_programming_elixir

プログラミングElixir読書会のレポジトリ
1 stars 0 forks source link

7.6 p73-74 パターンマッチは再帰的 #39

Open thara opened 5 years ago

thara commented 5 years ago
def for_location([ head = [_, target_loc, _, _] | tail ], target_loc) do
    [ head | for_location(tail, target_loc)  ]
end

便利ですよね。

Haskellでいうasパターンかな?