caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Constructors in camllight vs. ocaml
@ 1997-01-20 15:31 Simon Clematide
  1997-01-30 10:29 ` Xavier Leroy
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Clematide @ 1997-01-20 15:31 UTC (permalink / raw)
  To: caml-list

Why do camllight and ocaml treat constructors differently?

In camllight I can write
    #type ip = Pair of int * int;;
   Type ip defined.
and the system recognizes Pair automatically as a value
    #Pair;;
    - : int * int -> ip = <fun>

Doing the same in ocaml (1.03) I get:
        # type ip = Pair of int * int;;
        type ip = Pair of int * int
        # Pair;;
        The constructor Pair expects 2 argument(s),
        but is here applied to 0 argument(s)

I do prefer the behavior of camllight especially for porting SML code.

Simon

---
Simon Clematide
Stuessistr. 96
CH-8057 Zuerich
E-mail: sclematide@access.ch
Phone: +41 1 361 22 37







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

end of thread, other threads:[~1997-01-31  7:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-01-20 15:31 Constructors in camllight vs. ocaml Simon Clematide
1997-01-30 10:29 ` Xavier Leroy

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