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 OAA32275; Thu, 9 Oct 2003 14:44:06 +0200 (MET DST) 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 OAA24937 for ; Thu, 9 Oct 2003 14:44:05 +0200 (MET DST) Received: from indyio.rz.uni-saarland.de (indyio.rz.uni-saarland.de [134.96.7.3]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h99Ci4106821 for ; Thu, 9 Oct 2003 14:44:04 +0200 (MET DST) Received: from uni-sb.de (uni-sb.de [134.96.7.230]) by indyio.rz.uni-saarland.de (8.12.10/8.12.9) with ESMTP id h99Ci3K728807615 for ; Thu, 9 Oct 2003 14:44:03 +0200 (CST) Received: from cs.uni-sb.de (cs.uni-sb.de [134.96.252.31]) by uni-sb.de (8.12.10/2003073000) with ESMTP id h99Ci2Dx025357 for ; Thu, 9 Oct 2003 14:44:03 +0200 (CEST) Received: from mail.cs.uni-sb.de (mail.cs.uni-sb.de [134.96.254.200]) by cs.uni-sb.de (8.12.10/2003091100) with ESMTP id h99ChtMD024118 for ; Thu, 9 Oct 2003 14:44:02 +0200 (CEST) Received: from ps.uni-sb.de (grizzly.ps.uni-sb.de [134.96.186.68]) by mail.cs.uni-sb.de (8.12.10/2003073000) with ESMTP id h99CeZji002674 for ; Thu, 9 Oct 2003 14:40:35 +0200 (CEST) X-Authentication-Warning: email: Host grizzly.ps.uni-sb.de [134.96.186.68] claimed to be ps.uni-sb.de Received: from ps.uni-sb.de (zoidberg.ps.uni-sb.de [134.96.186.121]) by ps.uni-sb.de (8.11.6/8.11.0) with ESMTP id h99CeZS31487; Thu, 9 Oct 2003 14:40:35 +0200 Message-ID: <3F855743.7020406@ps.uni-sb.de> Date: Thu, 09 Oct 2003 14:40:35 +0200 From: Andreas Rossberg User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003 X-Accept-Language: de, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] Constructors as functions and tuples in constructors References: <3F843648.3030200@cs.washington.edu> <3F843C6E.8060407@ps.uni-sb.de> <3F8443C1.6030404@cs.washington.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; rossberg:01 rossberg:01 uni-sb:01 caml-list:01 grossman:01 allocating:01 parentheses:01 eek:99 uni-sb:01 darkened:01 munching:01 repetitive:01 kristian:01 compiler:01 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Dan Grossman wrote: > > (1) A pattern-match would have the potential of allocating memory, which > some may judge poorly. But the compiler could warn about this. Good point, but I don't think anybody would really care. > (2) This transformation does require the type A carries is transparent. > So we still couldn't relax the "other" restriction that a signature > cannot hide an unparenthesized t1 * t2 variant. Of course, no change there. > (3) It's not clear how far this trivial transformation should be > generalized. For example, given > type t = A of int * int * int * int > which of these should we allow > A(1,2,3,4) > A((1,2,3,4)) > A((1,2),(3,4)) > A(1,(2,3),4) > ... Not sure what your getting at. OCaml makes otherwise redundant parentheses around constructor argument types significant. That is a hack to allow for a more efficient representation. The idea is to make that hack as transparent as possible. But that aim of course is unrelated to changing the meaning of the multifix type operator * itself. So the first two of your examples should certainly be legal (and they are already), while the others should not, no more than ((1,2),(3,4)) : int * int * int * int (* eek! *) (1,(2,3),4) : int * int * int * int (* ouch! *) - Andreas -- Andreas Rossberg, rossberg@ps.uni-sb.de "Computer games don't affect kids; I mean if Pac Man affected us as kids, we would all be running around in darkened rooms, munching magic pills, and listening to repetitive electronic music." - Kristian Wilson, Nintendo Inc. ------------------- 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