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-17 (15:03)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Smells like duck-typing

On Wed, 2007-10-17 at 16:25 +0200, Daniel Bünzli wrote:
> Use a record with a phantom type (the type must be abstract for this  
> to work).

I would use something weaker, and I wouldn't use objects
either. To me, this is essentially a dynamic scenario,
so the data type should be dynamic. For example:

	type field_t = [
	| `Title of string
	| `Intro of string
	| `Body of string
	| `Field of string * string

	type story_t = field_t list


John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: