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 22D10BB81 for ; Fri, 30 Sep 2005 22:25:11 +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 j8UKPAii026855 for ; Fri, 30 Sep 2005 22:25:10 +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 WAA28858 for ; Fri, 30 Sep 2005 22:25:09 +0200 (MET DST) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j8UKP7Ol026845 for ; Fri, 30 Sep 2005 22:25:09 +0200 Received: from localhost (suiren [130.54.16.25]) by kurims.kurims.kyoto-u.ac.jp (8.13.1/8.13.1) with ESMTP id j8UKP3KF024125; Sat, 1 Oct 2005 05:25:05 +0900 (JST) Date: Fri, 30 Sep 2005 23:25:56 +0300 (EEST) Message-Id: <20050930.232556.55511360.garrigue@math.nagoya-u.ac.jp> To: argentoff@rtelekom.ru Cc: caml-list@inria.fr Subject: Re: [Caml-list] caml_hash_variant() From: Jacques Garrigue In-Reply-To: <200509301048.48943.argentoff@rtelekom.ru> References: <200509301048.48943.argentoff@rtelekom.ru> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 433D9F26.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 433D9F23.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 hash:01 hash:01 variants:01 hashing:01 compilation:01 polymorphic:01 jacques:01 jacques:01 caml:02 caml:02 variant:02 variant:02 objects:02 string:03 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 From: Paul Argentoff > What caml_hash_variant() can be used for? Well, what do you want to use it for? It lets you retrieve the 31-bit representation used for a poymorphic variant or method tag. This is useful if you want to access polymorphic variants or objects from your C code. Note that this hashing function is fixed, so depending on your performence requirements you might want to compute the hashed values before compilation, and completely drop the string representation. Jacques Garrigue