From: Chris Hecker <checker@d6.com>
To: Jean-Christophe.Filliatre@lri.fr (Jean-Christophe Filliatre),
Alain Frisch <frisch@clipper.ens.fr>
Cc: Caml list <caml-list@inria.fr>
Subject: "custom" operators in caml (was: Re: [Caml-list] Num library)
Date: Fri, 11 Oct 2002 11:35:25 -0700 [thread overview]
Message-ID: <4.3.2.7.2.20021011112904.01b300f0@mail.d6.com> (raw)
In-Reply-To: <15782.56161.649922.825529@pc8-123>
>when nums are involved within huge datatypes, you have to write
>structural comparison and hash functions for these types. This is a
>pain, really.
This brings up a general issue: from the C side you can create custom
blocks that have hooks for various operators
(finalize,compare,hash,serialize). Is there any way to do this from the ml
side? In other words, if you could hook into the num block somehow and
register these operators in caml that would allow you do embed them in
datastructures and use =, and the runtime would call eq_num.
Of course, you don't want the whole block to be custom, because you want
ocaml to scan it in the gc and you want it to be able to be operated on in
caml.
I assume there's no way to do this, since you'd need a new block type, and
there are no more tags left without lowering No_scan_tag, which would break
everything (or at least anything that has a big constant variant), I
assume. But I don't know.
Just another thought in my continuing desire to be able to do everything
without dropping to C...
Chris
-------------------
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
next prev parent reply other threads:[~2002-10-11 18:35 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-10 8:42 [Caml-list] Num library 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 ` Chris Hecker [this message]
2002-10-11 20:30 ` Pierre Weis
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=4.3.2.7.2.20021011112904.01b300f0@mail.d6.com \
--to=checker@d6.com \
--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