English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Overlapping features of variant types and tuples in Ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-05-16 (17:04)
From: Vesa Karvonen <vesa_karvonen@h...>
Subject: [Caml-list] Overlapping features of variant types and tuples in Ocaml
Consider the following code:

  type variant =
    | Tuple of (int * int)
    | Non_tuple of int * int

  let contents variant =
    match variant with
      | Tuple x ->
      | Non_tuple x ->

As you can tell, the above code does not compile with Ocaml 3.04:

  The constructor Non_tuple expects 2 argument(s),
  but is here applied to 1 argument(s)

Is there a good reason for this behaviour or would it be purely
beneficial to remove the special handling of type lists in variants?

Send and receive Hotmail on your mobile device: http://mobile.msn.com

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