caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* syntax question
@ 2008-05-29 22:23 Michael Vanier
  2008-05-30  0:32 ` [Caml-list] " Adam Granicz
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Vanier @ 2008-05-29 22:23 UTC (permalink / raw)
  To: caml-list

Hi everyone,

I got bitten by a simple syntax problem:

# let a = (1, 2);;
val a : int * int = (1, 2)
# type testme = Foo of int * int;;
type testme = Foo of int * int
# Foo a;;
The constructor Foo expects 2 argument(s),
but is here applied to 1 argument(s)
# Foo (1, 2);;
- : testme = Foo (1, 2)
# type testme2 = Foo2 of (int * int);;
type testme2 = Foo2 of (int * int)
# Foo2 a;;
- : testme2 = Foo2 (1, 2)

Why does the compiler treat int * int and (int * int) in type definitions so differently?  Is it to 
give clearer error messages in the typical case?

Mike





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

end of thread, other threads:[~2008-05-30 12:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-29 22:23 syntax question Michael Vanier
2008-05-30  0:32 ` [Caml-list] " Adam Granicz
2008-05-30  1:13   ` Michael Vanier
2008-05-30  1:48     ` Adam Granicz
2008-05-30  1:54     ` Gordon Henriksen
2008-05-30  7:03     ` Christophe TROESTLER
2008-05-30  7:06     ` Luc Maranget
2008-05-30 12:17     ` Damien Doligez

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