Browse thread
Smells like duck-typing
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Robert Fischer <robert@f...> |
| Subject: | Re: [Caml-list] Smells like duck-typing |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<blockquote cite="mid:377673.31302.qm@web54602.mail.re2.yahoo.com"
type="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>
</blockquote>
<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.
</pre>
</blockquote>
Mind showing me, formally, why you need "reverse inheritance"?<br>
<br>
Conceptually, you just need to fix your choice of names. Let me cite
the second paragraph of the e-mail you're responding to (which you
neglected in your response): <br>
<br>
> If you s/blurb/header/g or s/blurb/summary/g, then a Full story
arguably is-a blurb with a body tacked on.
<br>
<br>
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>
<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. This is
equivalent to saying that full stories are a subtype of
header/summaries/"blurbs".<br>
<br>
You are right smack dab onto the problem space that inheritance is
designed to solve.<br>
<br>
~~ Robert.<br>
</body>
</html>