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 Tue, May 22, 2001 at 08:27:01PM +0200, Remi VANICAT wrote:
> the 
> let rec ... = ..
> and ... = ...
> and ... = ...
> 
> make the trick

Great.  This is easy enough.  Thanks (and thanks to Markus).

> no you haven't, the function compare is a very good ordering for
> variant:
> 
> # compare `Aze `Azr ;;
> - : int = -1
> # compare (Some 0) None;;
> - : int = 1
> # type response = Yes | No;;
> type response = Yes | No
> # compare Yes No;;
> - : int = -1

I wasn't aware of this function, but it's exactly what I need.  Thanks again.

> yes this a problem. but often there is better way to print thing than
> just the name of the variant.
> 
> You can also use camlp4 to make a construct who build the variant and
> the printer at the same time.

I haven't had a chance to familiarize myself with camlp4 yet.  I guess I should.

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