(************************************************************ match2.ml Created : Mon Dec 9 14:22:27 2002 Last modified: Mon Dec 09 14:25:53 2002 Compile: ocamlopt.opt match2.ml -o match2 # FTP Directory: sources/ocaml # ************************************************************) type t = Tak | Mamewo | Hogera (* match with multiple value and pair*) let f = function Mamewo, t | Tak, t -> t (* A compile error occurs by the line below *) (* Mamewo, t | Tak, t -> t*) (*File "match2.ml", line 11, characters 4-22:*) (*Variable s must occur on both sides of this | pattern*) | _ -> assert false let _ = print_endline (f (Tak,"hoge"));