caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Erkki Seppala <flux-caml@inside.org>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Re: ancient module
Date: Wed, 15 Sep 2010 10:41:34 +0300	[thread overview]
Message-ID: <m49bp7zwj0x.fsf@coffee.modeemi.fi> (raw)
In-Reply-To: <20100914204817.GA25213@annexia.org> (Richard Jones's message of "Tue, 14 Sep 2010 21:48:17 +0100")

Richard Jones <rich@annexia.org> writes:

> On Tue, Sep 14, 2010 at 09:46:24PM +0100, Richard Jones wrote:
> Answering my own question, I guess you can use Map, but write a custom
> string comparison function.  Ought to work but not tested it :-)

And in similar fashion, one could use Hashtbl.Make to construct a custom
hash table with Hashtbl.HashedType, but provide a custom hashing (and
comparison) function. I assume also the default hashing function stops
upon finding data that's outside O'Caml heap.

Also, the compiler recognizes when strings are compared and calls the
comparing function directly. So let cmp (a : string) b = a < b produces
a call directly to caml_string_lessthan, which I assume would not make
any special checks.

-- 
  _____________________________________________________________________
     / __// /__ ____  __               http://www.modeemi.fi/~flux/\   \
    / /_ / // // /\ \/ /                                            \  /
   /_/  /_/ \___/ /_/\_\@modeemi.fi                                  \/


  reply	other threads:[~2010-09-15  7:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <7366F08F-88A4-40BA-95EE-1E682BEDBEFA@facebook.com>
2010-09-14 20:46 ` Richard Jones
2010-09-14 20:48   ` [Caml-list] " Richard Jones
2010-09-15  7:41     ` Erkki Seppala [this message]
2010-09-20 18:52   ` Gerd Stolpmann

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=m49bp7zwj0x.fsf@coffee.modeemi.fi \
    --to=flux-caml@inside.org \
    --cc=caml-list@yquem.inria.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).