caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] variant type
@ 2003-06-17 18:03 Ye Wu
  2003-06-17 18:15 ` Owen Gunden
  2003-06-18  8:12 ` Alex Romadinoff
  0 siblings, 2 replies; 3+ messages in thread
From: Ye Wu @ 2003-06-17 18:03 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-06-18  8:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-17 18:03 [Caml-list] variant type Ye Wu
2003-06-17 18:15 ` Owen Gunden
2003-06-18  8:12 ` Alex Romadinoff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).