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: | Ed Keith <e_d_k@y...> |
| Subject: | Re: [Caml-list] Smells like duck-typing |
--- "William D. Neumann" <wneumann@cs.unm.edu> 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