From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA09269; Sun, 27 May 2001 16:43:47 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA09258 for ; Sun, 27 May 2001 16:43:43 +0200 (MET DST) Received: from www.invert.com (invert.com [209.164.21.15]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f4REhfr22464 for ; Sun, 27 May 2001 16:43:42 +0200 (MET DST) Received: (from miles@localhost) by www.invert.com (8.10.1/8.10.1AA) id f4REhZH62496 for caml-list@inria.fr; Sun, 27 May 2001 07:43:35 -0700 (PDT) (envelope-from miles) Date: Sun, 27 May 2001 07:43:34 -0700 From: Miles Egan To: caml-list@inria.fr Subject: Re: [Caml-list] lisp -> ocaml Message-ID: <20010527074334.B62436@caddr.com> References: <20010522093341.A97425@caddr.com> <20010527150119.A8468@pauillac.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010527150119.A8468@pauillac.inria.fr>; from Xavier.Leroy@inria.fr on Sun, May 27, 2001 at 03:01:19PM +0200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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