ぱたーんまっちんぐ

http://jijixi.azito.com/cgi-bin/diary/index.rb?date=20060318#p02

letもパターンマッチングなので、

type t = A of int | B of int;;
let A i | B i = A 3;;

とかできるという話。

確かに便利なのですが、Variantをやろうとすると、

Warning P: this pattern-matching is not exhaustive.

とか出て嫌じゃありません?こういう警告をソースコードの特定の部分だけ抑制することって、できないのかな…

あと、リストも

let [x;y;z] = [1;2;3];;

とかできたりしますよ。