Re: [Caml-list] Physical counterpart to Pervasives.compare?

2009-08-24 Thread Jean-Christophe Filliâtre
Pascal Cuoq a écrit : Elnatan Reisner wrote: Is there something that can complete this analogy: (=) is to (==) as Pervasives.compare is to ___? The simple solution is to number at creation the objects that you want to physically compare, using an additional field. You can do that while

Re: [Caml-list] OCamlMakefile, menhir and its --infer option

2009-08-24 Thread Francois Pottier
Hello, On Thu, Aug 06, 2009 at 01:16:35PM +0200, ChoJin wrote: I have an issue while using OCamlMakefile, menhir and its --infer option. I don't know if OCamlMakefile properly supports menhir with the --infer option. The simplest solution to your problem would be to use ocamlbuild instead

Re: [Caml-list] Physical counterpart to Pervasives.compare?

2009-08-24 Thread Pascal Cuoq
Pascal Cuoq a écrit : Elnatan Reisner wrote: Is there something that can complete this analogy: (=) is to (==) as Pervasives.compare is to ___? The simple solution is to number at creation the objects that you want to physically compare, using an additional field. Since people are still

[Caml-list] lazy vs fun

2009-08-24 Thread Warren Harris
Is there any advantage to using lazy evaluation in ocaml rather than just using thunks to defer evaluation? E.g. let x = lazy (3+4) let y = Lazy.force x vs: let x = fun () - 3+4 let y = x () Perhaps it's just that the type int lazy_t is more informative than unit - int? Warren

Re: [Caml-list] lazy vs fun

2009-08-24 Thread Jake Donham
On Mon, Aug 24, 2009 at 2:57 PM, Warren Harriswar...@metaweb.com wrote: Is there any advantage to using lazy evaluation in ocaml rather than just using thunks to defer evaluation? E.g. let x = lazy (3+4) let y = Lazy.force x vs: let x = fun () - 3+4 let y = x () Lazy cells don't just

Re: [Caml-list] lazy vs fun

2009-08-24 Thread Stéphane Glondu
Warren Harris a écrit : Is there any advantage to using lazy evaluation in ocaml rather than just using thunks to defer evaluation? [...] Two things I can think of right now: they are evaluated only once (even if you call Lazy.force several times), and you can do pattern matching with them.

Re: [Caml-list] lazy vs fun

2009-08-24 Thread Martin Jambon
Martin Jambon wrote: Stéphane Glondu wrote: Warren Harris a écrit : Is there any advantage to using lazy evaluation in ocaml rather than just using thunks to defer evaluation? [...] Two things I can think of right now: they are evaluated only once (even if you call Lazy.force several times),

Re: [Caml-list] lazy vs fun

2009-08-24 Thread Warren Harris
On Aug 24, 2009, at 4:11 PM, Martin Jambon wrote: Oops. The following makes it possible for f to be garbage-collected: [...] If I understand correctly, the closure associated with f will be collectable after the lazy_t is forced, whereas before its lifetime would be bound to the

Re: [Caml-list] lazy vs fun

2009-08-24 Thread rixed
Oops. The following makes it possible for f to be garbage-collected: ...? Because the fact that the fun calls f does not count as a reference ? ___ Caml-list mailing list. Subscription management: