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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id AC6A7BC57 for ; Thu, 19 Aug 2010 15:34:58 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: As8BAFvQbEzRVdc0kGdsb2JhbACgVAgVAQEBAQkJDAcRAx+iI4kYghOGRS6IVAEBAwWFMgSJcQ X-IronPort-AV: E=Sophos;i="4.56,233,1280700000"; d="scan'208";a="55801278" Received: from mail-ew0-f52.google.com ([209.85.215.52]) by mail3-smtp-sop.national.inria.fr with ESMTP; 19 Aug 2010 15:34:57 +0200 Received: by ewy20 with SMTP id 20so1411489ewy.39 for ; Thu, 19 Aug 2010 06:34:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=rajsRWhk/QlKq39V3E9D1CV26pBK4VHrr9lOHH/HQ9c=; b=HzLubv5X+UgNfo/OH+mcR4ECFAxMlLN1PsiXpO6CGXjbIOJS9CTCsHl9FNc8rz7zXd QBuPKcwW0peOSLdZG1p7m7IItyRIU+kpU8+pz3tTYU+Hqifqo6Na12xKo+8lfSBddf99 qTqxKVial1J41IlKAWAGCOEsKdxuSS+I4Vd80= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=kTJzLeVNBT/Kp+VcRmmWpE6pVFEvnEEA0dp3s4RatrpNRd5uObRvUAlwJztTt96KoI koU/UI9bAe7rOg7mY4UtF9AfQUbDKqyyMsDWDEf6VCO9vc/0UQdaGMDvcuKXOVYSMNjy YQKgbuu26AdhwHJTMenGDq0zALASin6klEyA0= MIME-Version: 1.0 Received: by 10.213.13.130 with SMTP id c2mr724000eba.77.1282224897571; Thu, 19 Aug 2010 06:34:57 -0700 (PDT) Received: by 10.14.121.16 with HTTP; Thu, 19 Aug 2010 06:34:57 -0700 (PDT) In-Reply-To: References: Date: Thu, 19 Aug 2010 09:34:57 -0400 Message-ID: Subject: Re: [Caml-list] Question about float refs. From: David House To: Ethan Burns Cc: caml-list@yquem.inria.fr, Wheeler Ruml Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; val:01 val:01 caml-list:01 functions:01 int:01 int:01 define:02 float:03 float:03 let:03 let:03 refs:04 repr:04 repr:04 describe:07 Note that you can directly observe boxedness using the Obj functions: # type t1 = { a : float; b : int };; type t1 = { a : float; b : int; } # type t2 = { c : float; d : float };; type t2 = { c : float; d : float; } # let x1 = { a = 1.; b = 2 };; val x1 : t1 = {a = 1.; b = 2} # let x2 = { c = 3.; d = 4. };; val x2 : t2 = {c = 3.; d = 4.} # Obj.tag (Obj.repr x1);; - : int = 0 # Obj.tag (Obj.repr x2);; - : int = 254 For the use case you describe, I believe your best bet is to define a float_ref type as you describe.