From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q48Im3SN018638 for ; Tue, 8 May 2012 20:48:03 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ak0JAMxpqU9QRFuw/2dsb2JhbABEsg0EgRyBB4IMAQEFJxM/EAsYHBIUKCGIJbtPhVBBhHJDhGxjBJV9kEOCag X-IronPort-AV: E=Sophos;i="4.75,552,1330902000"; d="scan'208";a="142952161" Received: from furbychan.cocan.org ([80.68.91.176]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 08 May 2012 20:47:57 +0200 Received: from rich by furbychan.cocan.org with local (Exim 4.72) (envelope-from ) id 1SRpS0-0004qj-T6; Tue, 08 May 2012 19:47:56 +0100 Date: Tue, 8 May 2012 19:47:56 +0100 From: "Richard W.M. Jones" To: Goswin von Brederlow Cc: caml-list@inria.fr Message-ID: <20120508184756.GA18493@annexia.org> References: <87sjfd31z9.fsf@frosties.localnet> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87sjfd31z9.fsf@frosties.localnet> User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: [Caml-list] Implementation for a (nearly) typesafe shallow option type and a compiler bug? On Sun, May 06, 2012 at 02:53:14PM +0200, Goswin von Brederlow wrote: > The common problem here is that NULL is not unique for each type. So I > thought of a way to make it unique. I don't know whether or not it'll solve your problem, but there is another way to generate unique pointers that the OCaml runtime won't follow. That is, in C create a pointer to some static item: static char foo; value get_null (value ignored) { return &foo; } external get_null : unit -> null = "get_null" "noalloc" Rich. -- Richard Jones Red Hat