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.3 required=5.0 tests=AWL,HTML_MESSAGE autolearn=disabled version=3.1.3 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 95505BC69 for ; Fri, 5 Oct 2007 10:08:52 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAIKNBUdC+VLulmdsb2JhbACCPDWLRwIBAQcCCBERBw X-IronPort-AV: E=Sophos;i="4.21,234,1188770400"; d="scan'208";a="17324310" Received: from wx-out-0506.google.com ([66.249.82.238]) by mail4-smtp-sop.national.inria.fr with ESMTP; 05 Oct 2007 10:08:51 +0200 Received: by wx-out-0506.google.com with SMTP id h27so410878wxd for ; Fri, 05 Oct 2007 01:08:51 -0700 (PDT) Received: by 10.70.89.11 with SMTP id m11mr2270894wxb.1191571730822; Fri, 05 Oct 2007 01:08:50 -0700 (PDT) Received: by 10.70.83.1 with HTTP; Fri, 5 Oct 2007 01:08:50 -0700 (PDT) Message-ID: <28fa90930710050108o47b69dbdi8946e3b6ed11f7c@mail.gmail.com> Date: Fri, 5 Oct 2007 01:08:50 -0700 From: "Luca de Alfaro" To: caml-list@yquem.inria.fr Subject: Fwd: [Caml-list] Why can't I call a function over a subclass? In-Reply-To: <28fa90930710050108k34cff56dge24e1e9c4a01f9bd@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_6968_27047013.1191571730827" References: <28fa90930710050048p3d6f4e8cs8e13d0fe49d296f2@mail.gmail.com> <4705EF58.3040605@bik-gmbh.de> <28fa90930710050108k34cff56dge24e1e9c4a01f9bd@mail.gmail.com> X-Spam: no; 0.00; ocaml:01 ocaml:01 superclass:01 runtime:01 runtime:01 hars:01 hars:01 bik-gmbh:01 typechecker:01 enforces:01 subtypes:01 superclass:01 bik-gmbh:01 typechecker:01 enforces:01 ------=_Part_6968_27047013.1191571730827 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I meant to say: it seems to be that Ocaml breaks the principles of oo programming for no good reason, in this case. luca ---------- Forwarded message ---------- From: Luca de Alfaro Date: Oct 5, 2007 1:08 AM Subject: Re: [Caml-list] Why can't I call a function over a subclass? To: Inria Ocaml Mailing List I don't understand this. I thought the whole idea of oo programming was that you could use a subclass in place of a superclass... I also thought that the strict typing of Ocaml was there to avoid runtime errors, but if so, why does it complain in this situation, when no runtime error can possibly happen? It seems to me that the idea of oo programming is broken for no good reason... Luca On 10/5/07, Florian Hars < hars@bik-gmbh.de> wrote: > > Luca de Alfaro schrieb: > > The absurdity continues: > > This is not absurd, this is the documented correct behaviuor. > If *you* decide that f must only accept arguments of *exactly* > type r, the typechecker enforces your decision, as it does if > you decide that f may also accept subtypes of r (as long as your > decisions are consistent within he type system). > > Yours, Florian. > ------=_Part_6968_27047013.1191571730827 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I meant to say: it seems to be that Ocaml breaks the principles of oo programming for no good reason, in this case.

luca

---------- Forwarded message ----------
From: Luca de Alfaro <luca@dealfaro.org>
Date: Oct 5, 2007 1:08 AM
Subject: Re: [Caml-list] Why can't I call a function over a subclass?
To: Inria Ocaml Mailing List < caml-list@inria.fr>

I don't understand this.  I thought the whole idea of oo programming was that you could use a subclass in place of a superclass...

I also thought that the strict typing of Ocaml was there to avoid runtime errors, but if so, why does it complain in this situation, when no runtime error can possibly happen?

It seems to me that the idea of oo programming is broken for no good reason...

Luca


On 10/5/07, Florian Hars < hars@bik-gmbh.de> wrote:
Luca de Alfaro schrieb:
> The absurdity continues:

This is not absurd, this is the documented correct behaviuor.
If *you* decide that f must only accept arguments of *exactly*
type r, the typechecker enforces your decision, as it does if
you decide that f may also accept subtypes of r (as long as your
decisions are consistent within he type system).

Yours, Florian.

------=_Part_6968_27047013.1191571730827--