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=1.4 required=5.0 tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_WHOIS autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 864F2BC69 for ; Fri, 19 Oct 2007 15:08:53 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAMJJGEfOvicyoWdsb2JhbACOVwIBAQIFAggJCAEXgSc X-IronPort-AV: E=Sophos;i="4.21,300,1188770400"; d="scan'208";a="4851178" Received: from web54112.mail.re2.yahoo.com ([206.190.39.50]) by mail3-smtp-sop.national.inria.fr with SMTP; 19 Oct 2007 15:08:40 +0200 Received: (qmail 24766 invoked by uid 60001); 19 Oct 2007 13:08:38 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=vT2AfC45cKWKZpsf2ffSPtFD/gc9BXAd0QbXkm1Ti/ekm5TfKiTIzSRCff7ecwyjid6Dy01WCslAWrATcXhAdK1yTXwhyWkWAVQWQxOoq35GUZmme029WOSxWWP0npMnZg1rBM3OQ+fQT5BQp8HC8vNlj61AQldAbcB2P427zNg=; X-YMail-OSG: Ffb1JjEVM1lxsZauP1AZxpxQBRfSZ8nlN2vQBAtpHQiB2zO6o6TBO0f80_aX2_I73m0AdPFD3DmD16sC8TASatKZX5ToRm2kIpZCLu0zhcUBjpdIUYEWN.dSGNUZ.k76VDcybq3fYD9.Wc0- Received: from [129.44.179.6] by web54112.mail.re2.yahoo.com via HTTP; Fri, 19 Oct 2007 06:08:38 PDT Date: Fri, 19 Oct 2007 06:08:38 -0700 (PDT) From: Ed Keith Subject: Re: [Caml-list] Smells like duck-typing To: "William D. Neumann" , Dario Teixeira , Robert Fischer Cc: caml-list@yquem.inria.fr In-Reply-To: <20071018150419.M82068@cs.unm.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <761526.24683.qm@web54112.mail.re2.yahoo.com> X-Spam: no; 0.00; conceptually:01 subtype:01 model:01 model:01 ocaml:01 blog:98 wrote:01 wrote:01 abstract:01 caml-list:01 standpoint:01 inherit:01 neumann:02 functional:02 seems:03 --- "William D. Neumann" wrote: > On Thu, 18 Oct 2007 09:58:50 -0500, Robert Fischer > wrote > > > If you think that a full story as a story with a > summary/header, > > and also a body, then you're conceptually into > inheritance. > > > > From a formal standpoint, you're saying that all > full stories > > can be treated as headers/summaries/"blurbs", but > not all > > headers/summary/"blurbs" can be treated as full > stories. > > This is equivalent to saying that full stories are > a subtype > > of header/summaries/"blurbs". > > Well, I think the problem here is that the mental > model is reversed with > respect to the functional model. Mentally, blurbs > are kinds of stories -- > they are distinguished by their lack of a body. > Using the standard > inheritance lingo, however, stories are a kind of > blurb -- distinguished by > the inclusion of a body. Really, it seems like > we've got a six of one/half- > dozen of the other situation... > I'm new to Ocaml, but in C++ the solution would be to have an abstract base class 'story' and have 'full_story' and 'blurb' inherit from it. -EdK Ed Keith e_d_k@yahoo.com Blog: edkeith.blogspot.com __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com