From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id MAA16377; Wed, 24 Apr 2002 12:56:41 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA16152 for ; Wed, 24 Apr 2002 12:56:41 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from mel-rto1.wanadoo.fr (smtp-out-1.wanadoo.fr [193.252.19.188]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g3OAuWP10545 for ; Wed, 24 Apr 2002 12:56:33 +0200 (MET DST) Received: from mel-rta9.wanadoo.fr (193.252.19.69) by mel-rto1.wanadoo.fr; 24 Apr 2002 12:56:31 +0200 Received: from debian (80.8.81.4) by mel-rta9.wanadoo.fr (6.5.007) id 3CC5604F0003AA31 for caml-list@inria.fr; Wed, 24 Apr 2002 12:56:29 +0200 Received: from moi by debian with local (Exim 3.35 #1 (Debian)) id 170KRv-0000yi-00 for ; Wed, 24 Apr 2002 12:56:35 +0200 To: caml-list@inria.fr Subject: Re: [Caml-list] :: operator not quotable using ( ... ) References: <86662hviil.fsf@laurelin.dementia.org> From: Remi VANICAT Date: 24 Apr 2002 12:56:35 +0200 In-Reply-To: <86662hviil.fsf@laurelin.dementia.org> Message-ID: <874ri174bg.dlv@wanadoo.fr> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk John Prevost writes: > When writing an example just now for this list, I noticed that you can > no longer (assuming you ever could) write (::) or any variation > thereof to refer to the definition of the :: cons operator. Since > there is no other standard way to write this, one must use: cons is not really an operator, it's a constructor > > let cons x y = x :: y the same hold for any constructor : moi@debian:~/prog/ocaml-cvs$ ocaml Objective Caml version 3.04 # type foo = Bar of int * int;; type foo = Bar of int * int # Bar;; The constructor Bar expects 2 argument(s), but is here applied to 0 argument(s) # you have to write let bar x y = Bar (x, y) > > to get one. This is unfortunate when you wish to, say, define map in > terms of fold. My suspicion is that it may have worked in the past, > but broken by keyword argument parsing. Is there any chance (::) > could be special cased to work correctly, even though it conflicts > with (x : y) for typing? I don't think it likely that anybody would > write (::) intending to express a type. I don't know, but the true problem is the possibility to implicitly define function that correspond to constructor. -- Rémi Vanicat vanicat@labri.u-bordeaux.fr http://dept-info.labri.u-bordeaux.fr/~vanicat ------------------- 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