caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Overlapping features of variant types and tuples in Ocaml
@ 2002-05-16 17:04 Vesa Karvonen
  2002-05-16 19:17 ` Daniel de Rauglaudre
  0 siblings, 1 reply; 7+ messages in thread
From: Vesa Karvonen @ 2002-05-16 17:04 UTC (permalink / raw)
  To: caml-list

Consider the following code:

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

  let contents variant =
    match variant with
      | Tuple x ->
          x
      | Non_tuple x ->
          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


^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: [Caml-list] Overlapping features of variant types and tuples in Ocaml
@ 2002-05-16 19:45 Vesa Karvonen
  2002-05-16 19:57 ` Daniel de Rauglaudre
  0 siblings, 1 reply; 7+ messages in thread
From: Vesa Karvonen @ 2002-05-16 19:45 UTC (permalink / raw)
  To: caml-list

Daniel de Rauglaudre:
>On Thu, May 16, 2002 at 08:04:18PM +0300, Vesa Karvonen wrote:
> >   The constructor Non_tuple expects 2 argument(s),
> >   but is here applied to 1 argument(s)
>This is resolved by fixing the syntax of OCaml. But improving the
>syntax is supposed to be a loss of time by a lot of people.

I'm not quite sure what you mean. Do you mean that improving the
syntax is perceived to be waste of time by many people, or do you
mean that improving the syntax would waste the time of many people
(or both)?

I would estimate that it would take less than 30 minutes from a
capable Ocaml developer to change and test this issue by
modifying the Ocaml parser. After changing the syntax, it should
be possible to simplify the handling of variant types in the
compiler.


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.

-------------------
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] 7+ messages in thread
* Re: [Caml-list] Overlapping features of variant types and tuples in Ocaml
@ 2002-05-16 22:02 Vesa Karvonen
  0 siblings, 0 replies; 7+ messages in thread
From: Vesa Karvonen @ 2002-05-16 22:02 UTC (permalink / raw)
  To: caml-list

From: Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr>
>On Thu, May 16, 2002 at 10:45:44PM +0300, Vesa Karvonen wrote:
>
> > I'm not quite sure what you mean. Do you mean that improving the
> > syntax is perceived to be waste of time by many people.
>
>Right. Notice that your question is frequently asked. Your problem
>could be resolved syntactically (I mean by changing the syntax). See
>Camlp4 and its "revised syntax", section "types".

Thanks, I understand now that this issue has turned political and
technical arguments no longer have any value. I won't waste any more
of my time on this issue.


_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.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


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

end of thread, other threads:[~2002-05-17 11:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-16 17:04 [Caml-list] Overlapping features of variant types and tuples in Ocaml Vesa Karvonen
2002-05-16 19:17 ` Daniel de Rauglaudre
2002-05-17  8:17   ` Marc Pantel
2002-05-16 19:45 Vesa Karvonen
2002-05-16 19:57 ` Daniel de Rauglaudre
2002-05-17 11:40   ` Luc Maranget
2002-05-16 22:02 Vesa Karvonen

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).