例外処理

  1. 例外の定義

    # exception ZeroVector;;
  2. 例外の送出

    # raise ZeroVector;;
  3. 例外の処理

    # let strangle v1 v2 = try
    string_of_float(angle v1 v2)
    with ZeroVector -> "Not Defined";;

Ocaml TOPへ

NAGATA Akihito
Last modified: Fri Oct 5 15:42:39 JST 2001