Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Smells like duck-typing
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-10-18 (14:58)
From: Robert Fischer <robert@f...>
Subject: Re: [Caml-list] Smells like duck-typing
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
<blockquote cite=""
  <blockquote type="cite">
    <pre wrap="">That seems backwards from the way OO inheritance is supposed to work.  
You don't go from a more feature-rich case to a less feature-rich case 
-- it's the other way around.
  <pre wrap=""><!---->
Of course it is -- that is precisely why inheritance is the wrong
formalism for my problem!  What I need is a "reverse inheritance"
formalism, where a fully defined data structure sits at the root,
and whose descendants are PRUNED versions of the parent.
Mind showing me, formally, why you need "reverse inheritance"?<br>
Conceptually, you just need to fix your choice of names.&nbsp; Let me cite
the second paragraph of the e-mail you're responding to (which you
neglected in your response): <br>
&gt;&nbsp; If you s/blurb/header/g or s/blurb/summary/g, then a Full story
arguably is-a blurb with a body tacked on.
If you think that a full story as a story with a summary/header, and
also a body, then you're conceptually into inheritance.<br>
>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.&nbsp; This is
equivalent to saying that full stories are a subtype of
You are right smack dab onto the problem space that inheritance is
designed to solve.<br>
~~ Robert.<br>