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
[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: 2001-05-27 (14:43)
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.

To unsubscribe, mail  Archives: