Browse thread
syntax question
-
Michael Vanier
-
Adam Granicz
-
Michael Vanier
- Adam Granicz
- Gordon Henriksen
- Christophe TROESTLER
- luc.maranget@i...
- Damien Doligez
-
Michael Vanier
-
Adam Granicz
[
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: | Christophe TROESTLER <Christophe.Troestler+ocaml@u...> |
| Subject: | Re: [Caml-list] syntax question |
On Thu, 29 May 2008 18:13:09 -0700, Michael Vanier wrote: > > I realize that this is how it works, but I don't understand why it > should work this way. AFAIK elsewhere in ocaml "int * int" always > refers to a tuple. Similarly, if testme's Foo really took two int > arguments I would expect to be able to create Foos as "Foo 1 2" > instead of "Foo (1, 2)" which looks like Foo takes a single tuple > argument, not two int arguments. I don't see why "int * int" and > "(int * int)" are different things. Curried constructors are available in the revised syntax. But since the original syntax uses ``Foo (1, 2)'' for a constructor of 2 arguments, it is declared ``Foo of int * int'' by analogy with products. Hence the small glitch you noticed (in general that causes no problems however). My 0.02¤, ChriS