From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 8D769BC57 for ; Mon, 1 Mar 2010 13:53:02 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkQCAHtHi0tRZ906mWdsb2JhbACDBZgJFQEBAQEBCAsKBxMiqgSPMoE0gl1qBA X-IronPort-AV: E=Sophos;i="4.49,560,1262559600"; d="scan'208";a="57964631" Received: from queueout04-winn.ispmail.ntl.com ([81.103.221.58]) by mail4-smtp-sop.national.inria.fr with ESMTP; 01 Mar 2010 13:53:02 +0100 Received: from aamtaout04-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20100301124956.TMKK10950.mtaout03-winn.ispmail.ntl.com@aamtaout04-winn.ispmail.ntl.com>; Mon, 1 Mar 2010 12:49:56 +0000 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 <20100301124956.EIKL22934.aamtaout04-winn.ispmail.ntl.com@romulus.metastack.com>; Mon, 1 Mar 2010 12:49:56 +0000 Received: from Tenor ([212.183.140.34]) (authenticated bits=0) by romulus.metastack.com (8.14.2/8.14.2) with ESMTP id o21CnlGg017589 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 1 Mar 2010 12:49:51 GMT From: "David Allsopp" To: "=?UTF-8?Q?'St=C3=A9phane_Glondu'?=" , Cc: "'OCaml List'" References: <4B887AED.3090005@citycable.ch> <4B88F32C.3050701@citycable.ch> <87k4tyoq3m.fsf@frosties.localdomain> <4B891A0C.604@citycable.ch> <76EDF2F2-8B02-4C97-B083-EC74630D8ECA@mpi-sws.org> <4B896026.2070805@citycable.ch> <4B89780E.5080305@citycable.ch> <4B898179.1000600@citycable.ch> <4B8B9D15.7070300@glondu.net> <4B8BA350.8090404@citycable.ch> <4B8BB2EF.1010008@glondu.net> In-Reply-To: <4B8BB2EF.1010008@glondu.net> Subject: RE: [Caml-list] Recursive subtyping issue Date: Mon, 1 Mar 2010 12:49:46 -0000 Message-ID: <000c01cab93d$af05d8a0$0d1189e0$@romulus.metastack.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQG++dev6usjy+MhCCiCMQMXQZ/itALZ1N3bAhDBEaACMQ+SQQJi1d9iAtZavDECFUz3DwKgUGxPA1Sa9KMBLUbUWwG7IK8HAkw1psEBWUiUmg== Content-Language: en-gb Organization: MetaStack Solutions Ltd. X-Scanned-By: MIMEDefang 2.65 on 81.102.132.77 X-Cloudmark-Analysis: v=1.1 cv=1ggfb5FlKZQUfF3vzm9UBYZ2uTfLsbs/8dSljwg5+mE= c=1 sm=0 a=wNs1GRMElQMA:10 a=Cp1IFwq71HbLPiXxeCkA:9 a=TvPK2gXMXWSo31mz5J8AlEUQvBMA:4 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 X-Spam: no; 0.00; recursive:01 subtyping:01 guillaume:01 subtyping:01 fwiw:01 bindings:01 runtime:01 camlp:01 syntax:01 casts:01 phane:98 wrote:01 syntactic:01 caml-list:01 functions:01 St=C3=A9phane Glondu wrote: > Guillaume Yziquel a =C3=A9crit : > > Because subtyping seems more efficient than applying a noop = function. > > And this code might run really often, so I do not like very much the > > idea of having noop functions running really often. >=20 > FWIW, I don't think you have any penalty if you declare your = identities > as externals like Obj.{repr,obj,magic}. Yuk, some might say... but we > are in the context of bindings to other languages anyway. >=20 > > Moreover, having conversion functions is not really handy, from a > > syntactic point of view: It's quite convenient to write something = like > > > > let f : string -> obj :> string -> float t =3D blah blah blah... > > > > than doing the explicit, runtime, casting in the definition of f. >=20 > It's more convenient for me write letters and parentheses than the > symbol ":>" :-) Then you can write a camlp4 syntax extension to convert the casts to = x_of_y function calls :o)