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 TAA16281; Wed, 12 Dec 2001 19:50:21 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA16268 for ; Wed, 12 Dec 2001 19:50:20 +0100 (MET) Received: from smtp2-cm.mail.eni.net (smtp2-cm.mail.eni.net [216.133.226.135]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id fBCIoIH25381; Wed, 12 Dec 2001 19:50:18 +0100 (MET) 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 KAA08770; Wed, 12 Dec 2001 10:50:15 -0800 Message-Id: <4.3.2.7.2.20011212103956.00e4ced0@arda.pair.com> X-Sender: checker@arda.pair.com X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Wed, 12 Dec 2001 10:54:12 -0800 To: Francois.Pottier@inria.fr, caml-list@inria.fr From: Chris Hecker Subject: Re: [Caml-list] Function call with a list of parameters In-Reply-To: <20011212145253.A10180@pauillac.inria.fr> References: <4.3.2.7.2.20011211145019.028d8e50@arda.pair.com> <15382.13531.184819.989958@helios.info-ua> <4.3.2.7.2.20011211145019.028d8e50@arda.pair.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >The usual solution is as follows: > # let uncurry g (x,y) = g x y;; > val uncurry : ('a -> 'b -> 'c) -> 'a * 'b -> 'c = > # uncurry g (f());; > - : int = 3 Sure, but if I have a function that's like this: let f blah = (x,y) let g a b x y c d = ... Then I need to write a new uncurry to pass x y into the right parameters in g. At which point it's easier to just do the "let x,y = f blah in" construct. I'm not saying the lack of this feature is a showstopper or anything, but since the other guy brought it up, I figured I'd post about it since it's kind of bothered me for a while. :) It does seem like there's an asymmetry in parameters versus return values that might be worth looking into (in languages in general, not just caml). Bruce's example was interesting to me because I didn't know that lisp had tuples (as opposed to just lists). That reintroduces the asymmetry that I'm talking about, where if everything was just a list (both returns and params) then it would be symmetric and apply would just work. Even with tuples, lisp is still more symmetric since you can convert a tuple to a list generically and then pass it in with apply (according to Bruce's example). I would assume people way more knowledgable than me have analyzed the tradeoffs in the [a]symmetry before. Assuming it's interesting at all, which I don't know enough about languages to know that either. :) Chris ------------------- 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