caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Pierre Weis <pierre.weis@inria.fr>
To: Jean-Christophe.Filliatre@lri.fr
Cc: frisch@clipper.ens.fr, caml-list@inria.fr
Subject: Re: [Caml-list] Num library
Date: Fri, 11 Oct 2002 22:30:22 +0200 (MET DST)	[thread overview]
Message-ID: <200210112030.WAA16458@pauillac.inria.fr> (raw)
In-Reply-To: <15782.56161.649922.825529@pc8-123> from Jean-Christophe Filliatre at "Oct 11, 102 04:08:33 pm"

Hi Jean-Christophe,

> I'm not going to comment on the efficiency of Num.
> 
> But, for  having tried  to use  it in a  serious software  and finally
> replaced  it by  mlgmp, I  can mention  one true  weakness of  the Num
> library: there is  no unicity of representation (e.g. 1  can be Int 1,
> but  also Ratio  1/1, etc.)  and  consequently you  cannot use  caml's
> comparison and hash functions over it.

You should have reported this behaviour, since it is a bug: the
library was known to provide a normal form to value of type num. If it
fails to do so it is just an implementation flaw that we have to
correct.

> Of course, you  can use compare_num (hash_num is  lacking, though) but
> when  nums are  involved  within  huge datatypes,  you  have to  write
> structural comparison  and hash functions  for these types. This  is a
> pain, really.
> -- 
> Jean-Christophe

Yes, you're right, it is almost impossible to handle: that why the
library was supposed to provide a normal form for nums ...

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


      parent reply	other threads:[~2002-10-11 20:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-10  8:42 Alain Frisch
2002-10-10  9:42 ` sebastien FURIC
2002-10-10 14:56   ` Yaron M. Minsky
2002-10-10 17:14     ` Pierre Weis
2002-10-10 18:53       ` Alain Frisch
2002-10-11 20:01         ` Pierre Weis
2002-10-10 19:45       ` Yaron M. Minsky
2002-10-10 17:08   ` Pierre Weis
2002-10-11  9:26     ` Sebastien Furic
2002-10-11 20:17       ` Pierre Weis
2002-10-11 10:22     ` Alessandro Baretta
2002-10-11 13:23 ` Claude Marche
2002-10-11 16:14   ` Sebastien Furic
2002-10-11 14:08 ` Jean-Christophe Filliatre
2002-10-11 18:35   ` "custom" operators in caml (was: Re: [Caml-list] Num library) Chris Hecker
2002-10-11 20:30   ` Pierre Weis [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200210112030.WAA16458@pauillac.inria.fr \
    --to=pierre.weis@inria.fr \
    --cc=Jean-Christophe.Filliatre@lri.fr \
    --cc=caml-list@inria.fr \
    --cc=frisch@clipper.ens.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).