2007-03-06から1日間の記事一覧

オプション引数

$ocaml Objective Caml version 3.09.3 # let f x y = failwith (x^y);; val f : string -> string -> 'a = # (fun g -> g "foo" "bar") f;; Exception: Failure "foobar". OK。 # let f ?(a=0) x y = x ^ y;; val f : ?a:int -> string -> string -> string…