From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p0QMFg4e021148 for ; Wed, 26 Jan 2011 23:15:42 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjMBALIrQE1CbwQZkWdsb2JhbACWWo4gFQEBAgkLCgcRBCC8cgWFT4UbhxI X-IronPort-AV: E=Sophos;i="4.60,382,1291590000"; d="scan'208";a="74270111" Received: from out1.smtp.messagingengine.com ([66.111.4.25]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 26 Jan 2011 23:15:36 +0100 Received: from compute3.internal (compute3.nyi.mail.srv.osa [10.202.2.43]) by gateway1.messagingengine.com (Postfix) with ESMTP id A8046208C1 for ; Wed, 26 Jan 2011 17:15:35 -0500 (EST) Received: from frontend2.messagingengine.com ([10.202.2.161]) by compute3.internal (MEProxy); Wed, 26 Jan 2011 17:15:35 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:from:to:subject:message-id:mime-version:content-type; s=smtpout; bh=FKlC+iAVoKhYxixyEDaBCVOAYLY=; b=PYsgli5ePsyebUwsSX3mcueVTloB2yf3acUzpxvFoNidE346ZN7P/VzSee9/Hyv8Fxx06dKYaOYKqYlImakZaQVJRbVJzkJMUdXDh6TdWS3ZOe48q0JWC6bRnwS3T4cSIoZ7GXU/7ZRyi+vmce6nRVjnxM92uFPahQG7rNpzADM= X-Sasl-enc: YfllPUHrM/ewWxhVwEAdUcqrD5FddN51SPLJL1ocWLC3 1296080135 Received: from localhost (PRYOR-VAIO.PHILOSOPHY.FAS.NYU.EDU [128.122.70.6]) by mail.messagingengine.com (Postfix) with ESMTPSA id 775AD4413FC for ; Wed, 26 Jan 2011 17:15:35 -0500 (EST) Date: Wed, 26 Jan 2011 17:17:56 -0500 From: Jim Pryor To: caml-list@inria.fr Message-ID: <20110126221756.GA5907@vaio.jimpryor.net> Mail-Followup-To: caml-list@inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Subject: [Caml-list] Magic with fun (type t) ... ? I expect this is bad coding style, and should not be relied on. However, I was surprised at the behavior, and wondered whether it was intended: # let f = fun (type t) x -> let module M = struct exception E of t end in M.E x;; val f : 'a -> exn = f is polymorphic, as we expect: # f 1;; - : exn = E 1 # f "s";; - : exn = E "s" But now notice: # f ();; - : exn = E 0 # f None;; - : exn = E 0 It appears that non-heap values are always getting magicked into ints. Has this been noted before? -- Jim Pryor profjimm@jimpryor.net