Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] lisp -> ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Miles Egan <miles@c...>
Subject: Re: [Caml-list] lisp -> ocaml
On Sun, May 27, 2001 at 03:01:19PM +0200, Xavier Leroy wrote:
> > Second, the PAIP code makes fairly heavy use of Lisp's symbolic
> > features and uses symbols as a kind of type tag but also as
> > printable strings.  I've been using variants, both traditional and
> > polymorphic, as a substitute, but they're not really quite
> > equivalent.
> 
> Right.  The closest OCaml equivalent to a Lisp atom is unique strings,
> which are not provided by the standard library but can easily be
> implemented as a module.
> 
> With some trickery, you can even implement atoms with property lists,
> type safe but dynamically typed of course.  See the code below.
> (Warning: the implementation of properties is a real mind-twister,
> using a folklore trick to implement dynamics using references and
> functions that I learnt from Daniel de Rauglaudre, although it's been
> reinvented independently quite a number of times.)

Thanks for the suggestions and the code.  I'll give this a shot.

--
miles
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr