From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id VAA01982; Fri, 20 Feb 2004 21:36:03 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA04930 for ; Fri, 20 Feb 2004 21:36:00 +0100 (MET) Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i1KKZxae010583 for ; Fri, 20 Feb 2004 21:35:59 +0100 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AuHNO-00038k-00 for ; Fri, 20 Feb 2004 21:35:58 +0100 Received: from dsl254-102-129.nyc1.dsl.speakeasy.net ([216.254.102.129]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri Feb 20 20:35:58 2004 Received: from jdev by dsl254-102-129.nyc1.dsl.speakeasy.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri Feb 20 20:35:58 2004 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Jed Davis Subject: [Caml-list] Re: void/unit in C calls Date: Fri, 20 Feb 2004 15:36:04 -0500 Organization: Chaotic Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: dsl254-102-129.nyc1.dsl.speakeasy.net X-PGP-Key-URI: http://panix.com/~jdev/pubkey.asc http://cs.oberlin.edu/~jldavis/pubkey.asc X-PGP-Key-ID: 0xF33659F9 X-PGP-Key-Finger-Address: jdev@panix.com jldavis@cs.oberlin.edu X-PGP-Key-FP: A098 903E 9B9A DEF4 168F AA09 BF07 807E F336 59F9 User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.2 (darwin) Cancel-Lock: sha1:cVeO0CpDioLCsvNLnsfaFP5dkQo= X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; davis:99 foo:01 camlparam:01 camlreturn:01 camlreturn:01 o'caml's:01 foo:01 camlprim:01 davis:99 903:99 807:99 writes:01 336:97 referenced:02 imply:02 X-Attachments: type="application/pgp-signature" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk --=-=-= Content-Transfer-Encoding: quoted-printable "Lars Nilsson" writes: > Does this indicate an error in the O'Caml manual, section 18.5.1, where > > void foo(value v1, value v2, value v3) > { > CAMLparam3(v1, v2, v3); > > CAMLreturn0; > } > > is used, in addition to a paragraph preceeding it in the same section > saying "If your C function is a procedure you must insert CAMLreturn0 > at the end"? In fact, CAMLreturn0 existing at all seems to imply the > fact that unit-returning functions (from O'Caml's point of view) can > be void in the C implementation. It doesn't say that foo() is meant to be the implementation of an external in and of itself; in fact, the absence of a CAMLprim indicates that it's not meant to be one. It's just that any function that might set off a GC needs to declare its "value"s so they can be updated if the referenced blocks are moved, and thus needs a matching CAMLreturn. =2D-=20 [Jed Davis] A098 903E 9B9A DEF4 168F AA09 BF07 807E F336 59F9 0xF33659F9 "But life wasn't yes-no, on-off. Life was shades of gray, and rainbows not in the order of the spectrum." -- L. E. Modesitt, Jr., _Adiamante_ --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (Darwin) iD8DBQBANm+5vweAfvM2WfkRAmemAJ4/CsMjJLYTajP7EV2BOa8zvxBAUgCfZwHo UUXjwttvVlrrWjSvqoZYJZk= =gZBR -----END PGP SIGNATURE----- --=-=-=-- ------------------- 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