From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id CAA06657; Fri, 8 Jun 2001 02:36:28 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id CAA06670 for ; Fri, 8 Jun 2001 02:36:27 +0200 (MET DST) Received: from smtp2-cm.mail.eni.net (smtp2-cm.mail.eni.net [216.133.226.135]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f580aP905224 for ; Fri, 8 Jun 2001 02:36:26 +0200 (MET DST) Received: from checkerlap.d6.com (node-d8e9cca2.powerinter.net [216.233.204.162]) by smtp2-cm.mail.eni.net (8.9.3/8.9.3) with ESMTP id RAA06879; Thu, 7 Jun 2001 17:36:19 -0700 Message-Id: <4.3.2.7.2.20010607173329.03c5ca90@shell16.ba.best.com> X-Sender: def6@shell16.ba.best.com X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Thu, 07 Jun 2001 17:38:32 -0700 To: Mark Wotton From: Chris Hecker Subject: Re: [Caml-list] Currying in Ocaml Cc: caml-list@inria.fr In-Reply-To: References: <20010608084947C.garrigue@kurims.kyoto-u.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Let's start up the commuting labels discussion again!!! Ahem. I think you have to eta-expand: (fun t d -> print_all d t) I don't think there's a flip f x y = f y x in the pervasives library (why not, by the way, INRIA folks?), but it seems to be a common idiom, like fst and snd. As for overhead, "Assume Nothing," as they say. Try eta-expanding and let us know if you see a performance problem. Chris At 10:20 AM 6/8/01 +1000, Mark Wotton wrote: >Is it possible to curry on arbitrary parameters in Ocaml, or is it >strictly left to right? I have a function "print_all depth tree" and >sometimes I'd like to curry on depth, other times on tree. I see that if i >write a little wrapper like "rev_curry_print_all tree depth = print_all >depth tree" I could curry using that instead, but this function is called >inside a deep recursive loop and I'm worried that I'll get an unnecessary >function call overhead. Is there a better way of doing this? > >regards, >Mark > > >------------------- >Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ >To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr