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 TAA30414; Tue, 10 Apr 2001 19:27:35 +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 TAA30410 for ; Tue, 10 Apr 2001 19:27:35 +0200 (MET DST) Received: from mrwall.kal.com (mrwall.kal.com [194.193.14.236]) by nez-perce.inria.fr (8.11.1/8.10.0) with SMTP id f3AHRYn12000 for ; Tue, 10 Apr 2001 19:27:34 +0200 (MET DST) Received: from mrwall.kal.com [194.193.14.236] (HELO localhost) by mrwall.kal.com (AltaVista Mail V2.0J/2.0J BL25J listener) id 0000_0045_3ad3_4336_877d; Tue, 10 Apr 2001 18:30:30 +0100 MIME-Version: 1.0 Subject: RE: [Caml-list] variant with tuple arg in pattern match? Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable content-class: urn:content-classes:message X-MimeOLE: Produced By Microsoft Exchange V6.0.4417.0 Date: Tue, 10 Apr 2001 18:25:27 +0100 Message-ID: Thread-Topic: [Caml-list] variant with tuple arg in pattern match? Thread-Index: AcDBv+Az5dCLdm8ZSgyh3rSmQDtpvgAIlrIQ From: "Dave Berry" To: "Marcin 'Qrczak' Kowalczyk" , Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > From: Marcin 'Qrczak' Kowalczyk [mailto:qrczak@knm.org.pl] > Sent: Tuesday, April 10, 2001 14:12 > It's not a hack. When functions can return functions, there=20 > is no need of inventing the concept of multiparameter functions. >>From a theoretical perspective, of course not. From a programming perspective, there are several reasons, many of which I gave in my message. Others include ease of compilation, and familiarity to mainstream programmers. > > In cases where a function is explicitly returning another=20 > > (as opposed to > > just simulating multiple arguments), I think the explicit binding > > describes what is happening more clearly. >=20 > It's not opposition. This is semantically the same, so there=20 > is no need of introducing a syntactic difference. There are two levels of semantics here. At the higher level, we have the behaviour that the programmer is trying to communicate, which distinguishes returning a function as a result on the one hand from passing multiple arguments on the other. The lower level is how this is encoded in the programming language. With currying, there is no difference between the two, so information has been lost. With multiple arguments, the distinction is maintained. > Does map take a function and a list, returning a list, or does it lift > a function to a function operating on a list?=20 Or does it raise a list to a function operating on a function? Oops, no, it can't do that, because the person who defined the function didn't anticipate this use of it. Time to eta-expand and flip... Dave. ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr