[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Ye Wu <ywu1@c...> |
| Subject: | [Caml-list] variant type |
Could you please tell me why the following doesn't work?
type shape = Square of int * int * int
|Circle of float * float * float;;
let area s =
match s with
Square (_, _, d) -> d * d
|Circle (_, _, r) -> 3.14 *. r *. r;;
Regards,
Ye
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners