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 B52207EC6E for ; Tue, 17 Dec 2013 21:26:22 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of daniel.buenzli@erratique.ch) identity=pra; client-ip=74.55.86.74; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="daniel.buenzli@erratique.ch"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of daniel.buenzli@erratique.ch) identity=mailfrom; client-ip=74.55.86.74; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="daniel.buenzli@erratique.ch"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@smtp.webfaction.com) identity=helo; client-ip=74.55.86.74; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="postmaster@smtp.webfaction.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmgBAJWysFJKN1ZKnGdsb2JhbABZhxq1aIE2DgEBAQEBBg0JCRQogiUBAQEDASMEUgULCxoCJgICRxAGG4d0CASxBJhWF4EpjQYwMweCbjWBEwSeRBeOew X-IPAS-Result: AmgBAJWysFJKN1ZKnGdsb2JhbABZhxq1aIE2DgEBAQEBBg0JCRQogiUBAQEDASMEUgULCxoCJgICRxAGG4d0CASxBJhWF4EpjQYwMweCbjWBEwSeRBeOew X-IronPort-AV: E=Sophos;i="4.95,503,1384297200"; d="scan'208";a="41481951" Received: from mail6.webfaction.com (HELO smtp.webfaction.com) ([74.55.86.74]) by mail3-smtp-sop.national.inria.fr with ESMTP; 17 Dec 2013 21:26:21 +0100 Received: from [172.20.10.2] (170-225.197-178.cust.bluewin.ch [178.197.225.170]) by smtp.webfaction.com (Postfix) with ESMTP id CB4BF2090B68; Tue, 17 Dec 2013 20:26:19 +0000 (UTC) Date: Tue, 17 Dec 2013 21:26:17 +0100 From: =?utf-8?Q?Daniel_B=C3=BCnzli?= To: Ashish Agarwal Cc: caml list Message-ID: In-Reply-To: References: <4DDEBB7487B641C0834F09D522EA9918@erratique.ch> <1C9496037B6149EC970D65C3BFA490F7@erratique.ch> X-Mailer: sparrow 1.6.4 (build 1178) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: Re: [Caml-list] SDL2 bindings, testers and feedback welcome Le mardi, 17 d=C3=A9cembre 2013 =C3=A0 19:57, Ashish Agarwal a =C3=A9crit : > The desire to distinguish between a successful non-result vs an error is = reasonable, but it's hard to know where to draw the line. In that case the line is pretty clear, any function that may return an erro= r about the call through Sdl.get_error gets that type. But regarding the ov= erall discussion, for me it boils down to one of these choices: 1) Convert all error conditions to exceptions and say in the docs any funct= ion in the Sdl module may raise Sdl.Error=20=20 2) Keep it as it is now. =20=20 > Is it an error for Map.find to not find the item you asked for? Maybe. Ma= ybe not.=20=20 Actually this case is quite easy IMHO. When you devise a map data structure= you should have both Map.get : 'a t -> key -> 'a, that raises *Invalid_arg= ument* if the key is unbound (that's for code paths were you know the value= is in there) and Map.find : 'a t -> key -> 'a option, that returns None if= the key is unbound (that's for code paths were you don't know if the value= is there).=20=20 > I misspoke. What I meant is: I don't like short cryptic acronyms. They ap= pear random to me because I don't know what they mean.=20=20 Ok then ! The thing is that when you use combinators approaches and/or get = type errors you don't want to have long winded name prefixes. I think the n= ame just after the prefix is more important and here I don't use short cryp= tic acronyms: Vg.image, Vg.glyph, Vg.path, Vg.renderer etc.=20=20 Best, Daniel