From: Oliver Bandel <oliver@first.in-berlin.de>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Give back a Pair from C to OCaml?
Date: Thu, 17 Jan 2008 19:32:19 +0100 [thread overview]
Message-ID: <1200594739.478f9f33aa51f@webmail.in-berlin.de> (raw)
In-Reply-To: <9d3ec8300801170743k509a7c4wa9d8f490118a9653@mail.gmail.com>
Zitat von Till Varoquaux <till.varoquaux@gmail.com>:
> from the manual:
>
> >>Tuples are represented by pointers to blocks, with tag 0.
>
> You have to create a block with two fields and put each integer in
> one
> of these fields (ocaml integers that is). I can't tell you exactly
> from the top of my head but I do rememenber it isn't really hard.
[...]
I only have seen so much different docs about that topic.
For example OCaml-book from OReilly writes other things then
I found at other places.
But it doesn't matter what the OCaml-book says, only the reference
manual does count. But the reference manual is not an introductional
text, and so I may have to reread it to understand it.
For example I can use "CAMLprim value <functionname> (.....){...}"
or I can throw out "CAMLprim" (which is, what I found in the
OReilly-book).
Also "value x" or "int x" are working as C-parameters
of a function. But an OCaml-int is not the same like a
C-int, so I would expect gcc throw out at least a warning.
I have added "-Wall", but no warning there.
Possibly that's because what is mentioned in "18.2",
that int's are "value".
But there is no distinction between the OCaml-ints and the
machine's C-ints in that text. Is "an unboxed integer" meant
to be a machine's native int, 32 Bits or 64 Bits, depending on the
machine?. Can it be given as parameter and return value as it is?
At least the missing compiler-warnings seem to say me that.
Possibly I should read the reference manual in more detail
but possibly someone sees, what I have overseen...?!
Ciao,
Oliver
next prev parent reply other threads:[~2008-01-17 18:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-17 15:32 Oliver Bandel
2008-01-17 15:37 ` [Caml-list] " Berke Durak
2008-01-17 15:43 ` Till Varoquaux
2008-01-17 18:32 ` Oliver Bandel [this message]
2008-01-17 18:41 ` Richard Jones
2008-01-17 19:57 ` Oliver Bandel
2008-01-17 21:43 ` CAMLprim and co (was: Give back a Pair from C to OCaml?) Alain Frisch
2008-01-17 20:43 ` [Caml-list] Give back a Pair from C to OCaml? Florent Monnier
2008-01-17 21:05 ` Oliver Bandel
2008-01-17 22:26 ` Oliver Bandel
2008-01-17 23:58 ` Florent Monnier
2008-01-18 11:05 ` Richard Jones
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=1200594739.478f9f33aa51f@webmail.in-berlin.de \
--to=oliver@first.in-berlin.de \
--cc=caml-list@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