From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id F37C5BB94 for ; Sat, 23 Jul 2005 20:58:22 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j6NIwMhZ011599 for ; Sat, 23 Jul 2005 20:58:22 +0200 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 UAA16183 for ; Sat, 23 Jul 2005 20:58:22 +0200 (MET DST) Received: from mail.physik.uni-muenchen.de (mail.physik.uni-muenchen.de [192.54.42.129]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j6NIwLd8011596 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Sat, 23 Jul 2005 20:58:21 +0200 Received: from localhost (unknown [127.0.0.1]) by mail.physik.uni-muenchen.de (Postfix) with ESMTP id 2DAFC2000B; Sat, 23 Jul 2005 20:58:21 +0200 (CEST) Received: from mail.physik.uni-muenchen.de ([127.0.0.1]) by localhost (mail.physik.uni-muenchen.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 25562-02-11; Sat, 23 Jul 2005 20:58:19 +0200 (CEST) Received: from mailhost.cip.physik.uni-muenchen.de (kaiser.cip.physik.uni-muenchen.de [141.84.136.1]) by mail.physik.uni-muenchen.de (Postfix) with ESMTP id 58E2120004; Sat, 23 Jul 2005 20:58:19 +0200 (CEST) Received: from katrin.cip.physik.uni-muenchen.de (katrin.cip.physik.uni-muenchen.de [141.84.136.12]) by mailhost.cip.physik.uni-muenchen.de (Postfix) with ESMTP id 2A49126E87; Sat, 23 Jul 2005 20:58:17 +0200 (CEST) Received: by katrin.cip.physik.uni-muenchen.de (Postfix, from userid 3092) id 84BD616BBA; Sat, 23 Jul 2005 20:58:16 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by katrin.cip.physik.uni-muenchen.de (Postfix) with ESMTP id 8013122135; Sat, 23 Jul 2005 20:58:16 +0200 (CEST) Date: Sat, 23 Jul 2005 20:58:15 +0200 (CEST) From: Thomas Fischbacher To: Michael Alexander Hamburg Cc: caml-list@inria.fr Subject: Re: [Caml-list] How to do this properly with OCaml? In-Reply-To: Message-ID: References: X-BOFH: Daemons did it MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: amavisd-new at physik.uni-muenchen.de X-Miltered: at concorde with ID 42E2934E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 42E2934D.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 binary:01 heap:01 heap:01 ocaml:01 2005,:98 cip:98 cip:98 lambda:01 lambda:01 wrote:01 tuples:01 debian:02 physik:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Sat, 23 Jul 2005, Michael Alexander Hamburg wrote: > I was constructing a binary heap of tuples the other day. After pondering > these options, I just used Obj.magic 0 as the null value in the array. > The heap was in a module, so nothing else could see the array, and I could > prove that the code never accessed the null elements, so the use of > Obj.magic seemed justified. Big question is, of course, what does the GC think about this, and will the GC's view on such a hack change in future versions of ocaml? -- regards, tf@cip.physik.uni-muenchen.de (o_ Thomas Fischbacher - http://www.cip.physik.uni-muenchen.de/~tf //\ (lambda (n) ((lambda (p q r) (p p q r)) (lambda (g x y) V_/_ (if (= x 0) y (g g (- x 1) (* x y)))) n 1)) (Debian GNU)