caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Francois Berenger <berenger@riken.jp>
To: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] SDL2 bindings, testers and feedback welcome
Date: Wed, 18 Dec 2013 10:13:09 +0900	[thread overview]
Message-ID: <52B0F6A5.9060605@riken.jp> (raw)
In-Reply-To: <E4EEC1BBD8774284A9ADA60FE76237CD@erratique.ch>

On 12/18/2013 05:26 AM, Daniel Bünzli wrote:
> Le mardi, 17 décembre 2013 à 19:57, Ashish Agarwal a écrit :
>> 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 error about the call through Sdl.get_error gets that type. But regarding the overall discussion, for me it boils down to one of these choices:
>
> 1) Convert all error conditions to exceptions and say in the docs any function in the Sdl module may raise Sdl.Error
> 2) Keep it as it is now.
>
>> Is it an error for Map.find to not find the item you asked for? Maybe. Maybe not.
>
> 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_argument* 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).
>
>> I misspoke. What I meant is: I don't like short cryptic acronyms. They appear random to me because I don't know what they mean.
> 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 name just after the prefix is more important and here I don't use short cryptic acronyms: Vg.image, Vg.glyph, Vg.path, Vg.renderer etc.

Here is what I learned some time ago on this very same mailing-list;
at the top of some .ml file:

module Vg = Vector_graphics

I _love_ it.

-- 
Best regards,
Francois Berenger.


  reply	other threads:[~2013-12-18  1:13 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-17  6:11 Daniel Bünzli
2013-12-17  7:02 ` Anthony Tavener
2013-12-17 14:17 ` Florent Monnier
2013-12-17 15:14   ` Daniel Bünzli
2013-12-18  6:54   ` Erkki Seppala
2013-12-18  8:05     ` Anthony Tavener
2013-12-18  9:24       ` Daniel Bünzli
2013-12-18  8:18     ` Florent Monnier
2013-12-22 10:01       ` Kakadu
2013-12-30 13:28         ` Vu Ngoc San
2013-12-17 17:05 ` Ashish Agarwal
2013-12-17 17:47   ` Daniel Bünzli
2013-12-17 18:57     ` Ashish Agarwal
2013-12-17 19:45       ` Anthony Tavener
2013-12-18 15:40         ` Ashish Agarwal
2013-12-18 18:02           ` Yotam Barnoy
2013-12-18 19:53             ` Daniel Bünzli
2013-12-18 22:29               ` Ashish Agarwal
2013-12-18 22:45                 ` Daniel Bünzli
2013-12-17 20:26       ` Daniel Bünzli
2013-12-18  1:13         ` Francois Berenger [this message]
2013-12-18  6:44           ` Erkki Seppala
2013-12-18  9:21           ` Daniel Bünzli
2013-12-19  1:11             ` Florent Monnier
2013-12-19  6:39       ` Florent Monnier
2013-12-17 19:29     ` Erkki Seppala
2013-12-19  5:20 ` Florent Monnier
2013-12-19  5:27   ` Florent Monnier
2013-12-19  7:13   ` Daniel Bünzli
2013-12-19 12:38     ` Florent Monnier
2014-02-12 10:43 ` Daniel Bünzli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52B0F6A5.9060605@riken.jp \
    --to=berenger@riken.jp \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).