From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.6.10/8.6.6) id UAA04997 for caml-redistribution; Fri, 4 Oct 1996 20:56:36 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.6.10/8.6.6) with ESMTP id RAA01057 for ; Fri, 4 Oct 1996 17:30:36 +0200 Received: from relay2.eunet.fr (relay2.EUnet.fr [192.134.192.149]) by concorde.inria.fr (8.7.6/8.7.1) with SMTP id RAA03835 for ; Fri, 4 Oct 1996 17:30:34 +0200 (MET DST) Received: from dassav (dassav.dassault-avion.fr) by relay2.eunet.fr (5.65c8d/96.05.03) via EUnet-France id AA08546; Fri, 4 Oct 1996 17:30:05 +0200 (MET) Received: from fnet-ia1.dassault-avion.fr by dassav (5.x/SMI-SVR4) id AA01889; Fri, 4 Oct 1996 16:25:31 +0100 Received: by fnet-ia1.dassault-avion.fr (5.x/SMI-SVR4) id AA02917; Fri, 4 Oct 1996 16:33:20 +0100 Date: Fri, 4 Oct 1996 16:33:20 +0100 From: bravier@dassault-avion.fr (Utilisateur FNET) Message-Id: <9610041533.AA02917@fnet-ia1.dassault-avion.fr> Subject: ocamlc syntax and -i option Content-Type: text Apparently-To: caml-list@pauillac.inria.fr Sender: weis 961004 (* ========================================================================= *) Hi caml community, Here are a few suggestions about ocaml, all opinions are welcome. Thierry Bravier Dassault Aviation. DGT / DTN / ELO / EAV 78, Quai Marcel Dassault F-92214 Saint-Cloud Cedex France Telephone : (33) 01 47 11 53 07 Telecopie : (33) 01 47 11 52 83 E-Mail : bravier@dassault-avion.fr =============================================================================== INFIX OPERATORS : ================= Can `Foo.( + )' be used as an infix operator ? # Pervasives.(+) 1 2;; - : int = 3 # 1 Pervasives.+ 2;; Syntax error A prefix usage is available but a prefix usage would really be great otherwise you'd have to open all module defining prefix operators. Just suppose Pervasives were not open by default, you could not write [1; 2] Pervasives.@ [3;4];; but should write Pervasives.( @ ) [1; 2] [3;4];; =============================================================================== OCAMLC -i OPTION : ================== I often find myself recompiling source code with the -i option just to see the types. Unfortunately this also recreates a .cmo / .cmi file as a side effect, something not necessary (especially when you use make) when you just want to look at types. Would it be possible to have a `type-check-no object code' option that could be used with or without the existing -i option ? By the way, when using -i, if the type-checker finds a type-error you do not get the types of previous correct values. This would be useful too (as I often have to comment out the incorrect code to understand the error). =============================================================================== FUNCTOR SYNTAX : ================ % cat foo.ml module type DUMMY = sig val dummy : unit end module type FUNCTOR_1 = functor (Dummy : DUMMY) -> DUMMY (* ok *) module type FUNCTOR_2 (Dummy : DUMMY) = DUMMY (* why not *) % ocamlc -c foo.ml File "foo.ml", line 3, characters 22-23: Syntax error This extension would make the syntax more homogeneous and much easier for functors with multiple arguments module type FOO (Ma : MA) (Mb : MB) (Mc : MC) = MZ instead of module type FOO = functor (Ma : MA) -> functor (Mb : MB) -> functor (Mc : MC) -> MZ ===============================================================================