[Caml-list] Pervasives.compare != Pervasives.compare

2010-11-11 Thread Elnatan Reisner
I was surprised when I noticed the following behavior: Objective Caml version 3.11.2 # compare == compare;; - : bool = false # let f = compare;; val f : 'a -> 'a -> int = # f == compare;; - : bool = false # f == f;; - : bool = true # let g = compare;; val g : 'a -> 'a -> int = # f == g

[Caml-list] Re: interfacing Ocaml with Mathematica

2010-09-07 Thread Elnatan Reisner
On Sep 7, 2010, at 6:00 AM, caml-list-requ...@yquem.inria.fr wrote: Date: Tue, 7 Sep 2010 06:36:35 +0200 From: Basile Starynkevitch Subject: Re: [Caml-list] interfacing Ocaml with Mathematica To: zaid al-zobaidi Cc: caml-list@yquem.inria.fr Message-ID: <20100907063635.f2e4de47.bas...@starynkev

Re: [Caml-list] 2147483648l < 2147483647l

2010-01-19 Thread Elnatan Reisner
On Jan 19, 2010, at 1:28 PM, David Allsopp wrote: Goswin von Brederlow wrote: # 2147483648l;; - : int32 = -2147483648l Isn't that documented properly? I think in the docs I saw at least that ocaml will silently overflow ints. Arithmetic operations are allowed to overflow silently but at

Re: [Caml-list] Looking for C preprocessing language parser with OCAML interface

2009-10-21 Thread Elnatan Reisner
On Oct 21, 2009, at 8:29 AM, Yoonseok Ko wrote: I'm looking for a C preprocessing language parser with OCAML interface. I was recently looking for such a tool myself, and I came across the link below mentioning Yacfe, from about a year ago. Unfortunately, it seems that the link provided t

Re: [Caml-list] Re: ocaml sefault in bytecode: unanswered questions

2009-08-10 Thread Elnatan Reisner
On Mon, 2009-08-10 at 15:36 +0200, Martin Jambon wrote: > Elnatan Reisner wrote: > > On Sun, 2009-08-09 at 21:09 +0200, Alain Frisch wrote: > >> Note that (=) sometimes terminates for cylic values. > >> > >> # type t = A of t | B of t;; > >> type t =

Re: [Caml-list] Re: ocaml sefault in bytecode: unanswered questions

2009-08-10 Thread Elnatan Reisner
On Sun, 2009-08-09 at 21:09 +0200, Alain Frisch wrote: > On 8/9/2009 8:56 PM, Elnatan Reisner wrote: > > My other issue is that the description of (==) for mutable structures > > doesn't specify that it is symmetric; reading the documentation > > literally only implies th

Re: [Caml-list] Re: ocaml sefault in bytecode: unanswered questions

2009-08-09 Thread Elnatan Reisner
Continuing this conversation about equality... On Aug 9, 2009, at 9:20 AM, David Allsopp wrote: Ivan Chollet wrote: I would have thought physical equality implies structural equality, but it doesn't seem like it. Can you please explain to me what’s wrong there? "It does" - but only with t

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

2009-07-28 Thread Elnatan Reisner
Is there something that can complete this analogy: (=) is to (==) as Pervasives.compare is to ___? That is, is there a polymorphic total ordering with respect to *physical* entities, rather than to their structure? I'm afraid of getting into trouble with Obj.magic, but what would this do: let f (

Re: [Caml-list] Representation of different polymorphic variants guaranteed to be different?

2009-07-08 Thread Elnatan Reisner
On Wed, 2009-07-08 at 14:54 -0400, Eric Cooper wrote: > On Wed, Jul 08, 2009 at 08:35:27PM +0200, Bruno Daniel wrote: > > How is it ensured that I get a <> b for a and b created as > > polymorphic variants from two different identifiers? Will pattern > > matching give wrong results if I accidentall

[Caml-list] Int64 comparison

2009-03-17 Thread Elnatan Reisner
Do the polymorphic ordering functions -- (<), (>), etc. -- correspond to the numerical ordering for Int64s and Int32s? I assume so, but I didn't see this specified anywhere. If the answer is 'yes', is there a reason I should prefer Int64.compare n1 n2 < 0 to n1 < n2 ? If there's no specific r