Date: Sun, 20 Mar 2005 09:03:43 +0900 (JST) Message-Id: <20050320.090343.112301197.garrigue at math.nagoya-u.ac.jp> To: robertr at rftp.com Cc: lablgtk at math.nagoya-u.ac.jp Subject: Re: Simple marshaller "style" question From: Jacques Garrigue In-Reply-To: <423B9762.5020006 at rftp.com> References: <423B9762.5020006 at rftp.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Robert Roessler > So, given that marshal2 or whatever I do is being used via a "partial > application" (I think that is what you types call it) that goes into > the GtkSignal.t record, is there a more "HOF style" way of reusing > marshal2 but processing the argument(s) *before* the callback is > invoked, or is the custom version of marshal2 the best I can do? You just have to create your own data_conv, by modifying one of those available in Gobject.Data. No that you say it, it would also be easy to provide a general way to do this composition. That is provide a function: val wrap_conv : inj:('a -> 'b) -> proj:('b -> 'a) -> 'b data_conv -> 'a data_conv I just never realized there was a need for that. Jacques