From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id C32807F164 for ; Mon, 7 Mar 2016 03:43:14 +0100 (CET) IronPort-PHdr: 9a23:e0I6jhVLYJ57Gd12nSJBdvQ+ydDV8LGtZVwlr6E/grcLSJyIuqrYZhyCt8tkgFKBZ4jH8fUM07OQ6PC/HzxYqsrR+Fk5M7VyFDY9wf0MmAIhBMPXQWbaF9XNKxIAIcJZSVV+9Gu6O0UGUOz3ZlnVv2HgpWVKQka3CwN5K6zPF5LIiIzvjqbpq8KVM10D2Gr1SIgxBSv1hD2ZjtMRj4pmJ/R54TryiVwMRd5rw3h1L0mYhRf265T41pdi9yNNp6BprJYYAu3SNp41Rr1ADTkgL3t9pIiy7UGCHkOz4S47WWwTllJtCgnB7Rf1FrPwqTey4uF03S3fOcztUZg1Xy6j5uFlUkm7pj0AMmsW93rIi8o4kqVd6Di7qhBy2YrTf8nBO/1lYaLbOM1fT0JeU8wXWyEXUdD0VJcGE+dUZbUQlIL6vVZb6ELmXQQ= Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=goswin-v-b@web.de; spf=Pass smtp.mailfrom=goswin-v-b@web.de; spf=None smtp.helo=postmaster@mout.web.de Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of goswin-v-b@web.de) identity=pra; client-ip=212.227.17.12; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of goswin-v-b@web.de designates 212.227.17.12 as permitted sender) identity=mailfrom; client-ip=212.227.17.12; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mout.web.de) identity=helo; client-ip=212.227.17.12; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="postmaster@mout.web.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0C3AAC86dxWlgwR49RdrTMEA4ohiVOHMDwQAQEBAQEBAQEQAQEBAQcNCQkhL4ItglV7FCAFKCGIHwEVBKB3mRQfhSmSOYEPBY0wiXqBI4xAiSUKhVVEjhE3gi0SCIFJiiYBAQE X-IPAS-Result: A0C3AAC86dxWlgwR49RdrTMEA4ohiVOHMDwQAQEBAQEBAQEQAQEBAQcNCQkhL4ItglV7FCAFKCGIHwEVBKB3mRQfhSmSOYEPBY0wiXqBI4xAiSUKhVVEjhE3gi0SCIFJiiYBAQE X-IronPort-AV: E=Sophos;i="5.22,549,1449529200"; d="scan'208";a="167355009" Received: from mout.web.de ([212.227.17.12]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Mar 2016 03:43:14 +0100 Received: from frosties.localnet ([134.3.242.84]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0LlFDW-1a2sMB2tFO-00b0cA for ; Mon, 07 Mar 2016 03:43:13 +0100 Received: from mrvn by frosties.localnet with local (Exim 4.84) (envelope-from ) id 1acl8b-0008Af-3f for caml-list@inria.fr; Mon, 07 Mar 2016 03:43:13 +0100 Date: Mon, 7 Mar 2016 03:43:13 +0100 From: Goswin von Brederlow To: Ocaml Mailing List Message-ID: <20160307024312.GB31098@frosties> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Provags-ID: V03:K0:nAvUz/Wd0Me6NUnMR1axm17RJZSZB3ekodbWYGfeSO8xmhROeQb WmwlTfYLoLqAm/WmT1ALOdDZwcW3pTlmishU4Dz6i7OzGf7j9nYIIHgdlo/6DNtad6KJ6/d nIA++tmLYuepXdaipyRev96USQXkZxQfm0m2y2lWNrXLr22jlynfgjKwR6etYOgFGtOCt/c ZmoYgBK2k2GwrHkMWVDIQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:f+wjwU2/IH0=:PNsqtQFW/ZWhBRYw+6t5OT yMxblyr9Hy7mjs6XIty2t9IIp5LevzLXUlbsmwfyYX9Z89jxgE4JX2uh9pCVuwNf7XMObp8bZ 8sRHZ4pBl0sFaAOadjZkvATOayk7UKx2zQlOlFGO2Gd0azVQJ7sJQDwTqlqeQeeAy2rf2IkHX 7tLvWL5256/WsipK3phxA8wJ4lbbKhPqfbmlLOPDnSUb7CYG9aDyJYdpR2EHMkCxzAy9OIvUB ZT4i7uZCTNoXA2j6NdUeZksE1+cMKo/8kiu6ZL0DkQOkRZiRBJE2YPMR3u/gAUGpnUMEg9v4x J5bXgurjOg1273MiWe0jtDsQG1uFm6UeZPZelzzsd/iixEgf455ZTXwP7akNzke2VXSEZa3Fd L13M0NEW5UPzZSqLQwiDlumbnvSpUMzdfknzPV5vh+nOhJewpUK+q/clX8KTmzY4sFl6haJq/ bVsc3Nj3nK3IsTZ2B8scF0KraLgNqfTlTvu1at5C+5O/P4EArHcNisFs0KMS91JCLRX9pX+9L i9YsSm5FpBIf0RBlMAqkLZKroTLeOQVTGGFBuLV2XOTEFrOPv1GQDeYWM/ZEL0ZweEDQS/mwk 6MprXdbbYsYtqMa9kEP+hSsYoLEnR9Ih3x5Y3N467VfF+bYJC1zqJbgca1W5MN58kC2PTsQem ipK20wCRZKfqwCpIUL8pt65xZ8qBDtoqrKnIt+PK5bga4X9jPqQRBrz7ebF2AHeZCe5g4Mfcq VQXie5aD/+8sAiwpv00gLVIt8zH1KXmjuPyEl6V/ZNVlwv2rMspAkf5sY8Q= Subject: [Caml-list] How safe is caml_get_public_method() to check if an object has a method? Hi, /usr/include/caml/mlvalues.h says: CAMLextern value caml_get_public_method (value obj, value tag); /* Called as: caml_callback(caml_get_public_method(obj, caml_hash_variant(name)), obj) */ /* caml_get_public_method returns 0 if tag not in the table. Note however that tags being hashed, same tag does not necessarily mean same method name. */ In QT5 the classes have virtual methods that can be overloaded. I'm considering allowing the ocaml classes to have methods by the same name. The C glue would then check if the ocaml class has such a method and call it. Otherwise the original method from QT5 would be called. The question now is wether that is save to do? Is it save as long as the names produce unique hash_variant values? Or are the hash tables in objects only parts of the bits of the hash_variant and therefore collide far more often (given a non-existant method name)? MfG Goswin