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 p0LFKYk0019916 for ; Fri, 21 Jan 2011 16:20:34 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmsBAO8yOU3RVaA0iWdsb2JhbACEE5I1jhQIFQEBAQoLCAkQBSCkDYk/glOEX4kGAQEDBYEfgzh0BIsfiUs X-IronPort-AV: E=Sophos;i="4.60,358,1291590000"; d="scan'208";a="73693229" Received: from mail-pw0-f52.google.com ([209.85.160.52]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-MD5; 21 Jan 2011 16:20:28 +0100 Received: by pwi5 with SMTP id 5so390151pwi.39 for ; Fri, 21 Jan 2011 07:20:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=xRr/HM0hKxIgKpF5g//0HgCdkHxdWbyM/WSt1GrDFXE=; b=tPqfQnyDJ1mTV7++c3HB2sNB/f9hoe4H8VFnOxMpoTEr4/Of5/O8zT0Nq7IlXri9+t U16OEfGQBCBuIo9nqoWUAPGGYb2EyD+8kutHBQDtF4Wpj2jO9bZLbWiN7PXz5pe/KpaD 5NEVuyqjwvJDfhi2sHQUXllEO+IFKogN/AOEI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=sT4upVchSVHbPVuLH4jTKOezCbF46lFtlz1lR314cVOAQwf4i63EygkUcp68q+5KNf DyjHqLz4WlAcyW+o7PR9zZ6qrnLlA2RNr+B4wzPOtEK1329elncVdue77O1XI4lKLU7D 01VspH3R7AqeO+HwqgSg6+QjwdN6jyvnt711k= MIME-Version: 1.0 Received: by 10.142.203.6 with SMTP id a6mr756095wfg.336.1295623226232; Fri, 21 Jan 2011 07:20:26 -0800 (PST) Sender: daniel.c.buenzli@gmail.com Received: by 10.142.73.8 with HTTP; Fri, 21 Jan 2011 07:20:26 -0800 (PST) In-Reply-To: <1295617774936@names.co.uk> References: <1295617774936@names.co.uk> Date: Fri, 21 Jan 2011 16:20:26 +0100 X-Google-Sender-Auth: x_WIJmon_TEvUehylbiYFtEprhI Message-ID: From: =?UTF-8?Q?Daniel_B=C3=BCnzli?= To: caml-list@yquem.inria.fr Content-Type: text/plain; charset=UTF-8 Subject: Re: [Caml-list] writing some code using a function for which only the signature is known On Fri, Jan 21, 2011 at 14:49, wrote: > For anything more than toy examples, it's better to use Dmitry's solution of > a specially defined exception, because you certainly don't want the > exception to get caught before it reaches the top level, but Assert_failure > or Failure are liable to get caught if you write code with exception > handling. In that case simply use invalid_arg "TODO", Invalid_argument exceptions should never be catched. This avoids having to define your own exception. Best, Daniel