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 (15:47)
From: Loup Vaillant <loup.vaillant@g...>
Subject: Re: [Caml-list] Smells like duck-typing
2007/10/18, William D. Neumann <>:
> 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...

It feels like the problem is the keyword "inherit". It suggest
C++/Java subtyping, while we just want code reuse. If having stories
inheriting from one another eventually result in less code, I would
consider that cleaner, no matter what "inherit" is supposed to mean.

Sometimes, a tool can be good at something it has not be designed for.
I think this might be the case, here.

Loup Vaillant