From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id EF6C2BBAF for ; Tue, 6 Oct 2009 14:45:09 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8BAG/YykpRZ90vkWdsb2JhbACadwEBAQEJCwoHEwO3boQqBIFT X-IronPort-AV: E=Sophos;i="4.44,513,1249250400"; d="scan'208";a="34341991" Received: from mtaout01-winn.ispmail.ntl.com ([81.103.221.47]) by mail2-smtp-roc.national.inria.fr with ESMTP; 06 Oct 2009 14:45:09 +0200 Received: from aamtaout04-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout01-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20091006124509.BXJF17029.mtaout01-winn.ispmail.ntl.com@aamtaout04-winn.ispmail.ntl.com>; Tue, 6 Oct 2009 13:45:09 +0100 Received: from romulus.metastack.com ([81.102.132.77]) by aamtaout04-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20091006124509.PVCP22934.aamtaout04-winn.ispmail.ntl.com@romulus.metastack.com>; Tue, 6 Oct 2009 13:45:09 +0100 Received: from Tenor ([172.16.0.8]) (authenticated bits=0) by romulus.metastack.com (8.14.2/8.14.2) with ESMTP id n96Cj5FK023658 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 6 Oct 2009 13:45:06 +0100 From: "David Allsopp" To: "'Chantal KELLER'" , "'caml-list'" References: <4ACB319A.1080608@wanadoo.fr> In-Reply-To: <4ACB319A.1080608@wanadoo.fr> Subject: RE: [Caml-list] Constructors are not functions Date: Tue, 6 Oct 2009 13:45:04 +0100 Message-ID: <003901ca4682$d47f8460$7d7e8d20$@metastack.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcpGfMUXt+JlJwj0Sw+GG/w0q0M9lwABLu+A Content-Language: en-gb Organization: MetaStack Solutions Ltd. X-Scanned-By: MIMEDefang 2.65 on 81.102.132.77 X-Cloudmark-Analysis: v=1.0 c=1 a=Mv2A4AzjtYwA:10 a=ZOzjf2MOAAAA:8 a=iULWI4Fi8WzPRprG_xAA:9 a=wI9JrmfmWk82OWnUbggFEAqs6CUA:4 X-Spam: no; 0.00; constructors:01 constructors:01 simulate:01 ocaml:01 camlp:01 foo:01 sml:01 sml:01 unbound:01 partial:01 caml-list:01 caml-list:01 functions:01 functions:01 constructor:01 > Is there a reason for constructors not to behave like functions? For > instance, one cannot make a partial application from a constructor: This is how SML handles constructors, Xavier explained the reasons he = chose to depart from this in: http://caml.inria.fr/pub/ml-archives/caml-list/2001/08/47db53a4b425297086= 47c9e81183598b.en.html I think it would be possible to simulate the SML behaviour in OCaml = using camlp4 (if you assume that for [type foo =3D Bar of int] that = future unbound references to [bar] are interpreted as [fun x -> bar x] = instead of an error) David