Delivered-To: garrigue at math.nagoya-u.ac.jp Delivered-To: lablgtk at yquem.inria.fr Message-ID: <49411B69.7080600 at comlab.ox.ac.uk> Date: Thu, 11 Dec 2008 13:53:45 +0000 From: Mike Spivey MIME-Version: 1.0 To: lablgtk at yquem.inria.fr Subject: Re: [Lablgtk] Binding for gtkSourceView-2.0 References: <4940ED23.9010808 at comlab.ox.ac.uk> <49410E1F.1080203 at cea.fr> In-Reply-To: <49410E1F.1080203 at cea.fr> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Benjamin Monate Benjamin Monate wrote: > If you intend to do it yourself, do not hesitate to post regular > progress/status reports so that we can help you. I have made a rough draft of a binding, but have only just begun to test it. I don't know if I will find the time to test and debug those parts that I don't need for my current project. My experience so far is that more than 50% of the C primitives I've written have conversion problems, so testing is very important. I hope things get better with time. However, I'm very willing to share what I have once some parts of it are working. For now, a couple of interface questions: (1) Is there a fixed rule for what methods take () as a final parameter? Methods with side effects and no arguments, yes; but what about methods like method guess_language : ?filename:string -> ?content_type:string -> unit -> source_language (* or raise Not_found *) that have no side-effects and only optional arguments? (2) On the same example: if a C method with type t may return NULL, then we have multiple possibilities in OCaml: (i) return "t option" (ii) return "t", but raise Not_found if the result is NULL (iii) if t = string, then return the empty string for NULL A similar question applies to arguments that may be NULL. Is there a rule that I should follow? (3) Text iterators are wrapped in a non-mutable way, with method forward_char : iter returning a fresh iterator. But in gText.view there is a method method forward_display_line_end : iter -> bool that mutates its argument. Can this be right? And finally: is it possible to have a C primitive that takes labelled arguments? Best wishes, -- Mike _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk