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 TAA22519; Tue, 17 Apr 2001 19:33:48 +0200 (MET DST) Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA22514 for caml-list@pauillac.inria.fr; Tue, 17 Apr 2001 19:33:47 +0200 (MET DST) 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 SAA20206 for ; Wed, 11 Apr 2001 18:26:37 +0200 (MET DST) Received: from elbereth.pgh.arsdigita.com (fw1.pgh.arsdigita.com [63.124.128.66]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f3BGQOf04126; Wed, 11 Apr 2001 18:26:25 +0200 (MET DST) Received: (from jmp@localhost) by elbereth.pgh.arsdigita.com (8.11.2/8.11.2/SuSE Linux 8.11.1-0.5) id f3AMYjH04726; Tue, 10 Apr 2001 18:34:45 -0400 X-Authentication-Warning: elbereth.pgh.arsdigita.com: jmp set sender to jmp@arsdigita.com using -f To: "Dave Berry" Cc: "Frank Atanassow" , "Daniel de Rauglaudre" , Subject: Re: [Caml-list] variant with tuple arg in pattern match? References: From: John Prevost In-Reply-To: Message-ID: User-Agent: Gnus/5.090001 (Oort Gnus v0.01) Emacs/21.0.91 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: 10 Apr 2001 18:34:45 -0400 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >>>>> "db" == Dave Berry writes: db> As for syntax versus semantics, I nearly wrote "semantic db> hack", until I realised that it only works if the syntax also db> supports it. Actually, it works regardless. It's just that a convenient syntax makes it nicer. For example: (define (map f) (let ((map' l) (cond ((cons? l) (cons (f (car l)) (map' (cdr l)))) (t l)) map')) ((map (lamba (x) (+ x 2))) '(1 2 3 4 5)) This is a curried function in Scheme: it's not as nice as in a language with a simpler (juxtaposition) application syntax, but it's the same operation. It's just that ML makes using curried functions simpler. The fact that this is more possible in Scheme, by the way, is one of the things that makes Scheme superior to Lisp. The fact that function values and normal values are considered to be different in Lisp just complicates things. John. ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr