From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 251CFBB9C for ; Sun, 18 Sep 2005 16:38:01 +0200 (CEST) Received: from mail.physik.uni-muenchen.de (mail.physik.uni-muenchen.de [192.54.42.129]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j8IEc04m019303 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Sun, 18 Sep 2005 16:38:00 +0200 Received: from localhost (unknown [127.0.0.1]) by mail.physik.uni-muenchen.de (Postfix) with ESMTP id 5C2A320014; Sun, 18 Sep 2005 16:38:00 +0200 (CEST) Received: from mail.physik.uni-muenchen.de ([127.0.0.1]) by localhost (mail.physik.uni-muenchen.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 08682-03-10; Sun, 18 Sep 2005 16:37:56 +0200 (CEST) Received: from mailhost.cip.physik.uni-muenchen.de (kaiser.cip.physik.uni-muenchen.de [141.84.136.1]) by mail.physik.uni-muenchen.de (Postfix) with ESMTP id D3F402000C; Sun, 18 Sep 2005 16:37:56 +0200 (CEST) Received: from eiger.cip.physik.uni-muenchen.de (eiger.cip.physik.uni-muenchen.de [141.84.136.54]) by mailhost.cip.physik.uni-muenchen.de (Postfix) with ESMTP id 2404326F4D; Sun, 18 Sep 2005 16:37:56 +0200 (CEST) Received: by eiger.cip.physik.uni-muenchen.de (Postfix, from userid 3092) id 444BB12F75; Sun, 18 Sep 2005 16:37:56 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by eiger.cip.physik.uni-muenchen.de (Postfix) with ESMTP id 3F7C012F17; Sun, 18 Sep 2005 16:37:56 +0200 (CEST) Date: Sun, 18 Sep 2005 16:37:56 +0200 (CEST) From: Thomas Fischbacher To: yoann padioleau Cc: Jonathan Roewen , caml-list@yquem.inria.fr Subject: Re: [Caml-list] lisp to ocaml In-Reply-To: Message-ID: References: X-BOFH: Daemons did it MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: amavisd-new at physik.uni-muenchen.de X-Miltered: at concorde with ID 432D7BC8.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 factorial:01 ocaml:01 parens:01 infix:01 2005,:98 ...:98 ...:98 cip:98 cip:98 lambda:01 lambda:01 wrote:01 syntactic:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_FAIL autolearn=disabled version=3.0.3 On Sun, 18 Sep 2005, yoann padioleau wrote: > You can also in some scheme (such as plt scheme) use other symbols than > parenthesis such as '[' ']'. > It reduces the number of () and makes some code looks better. > > for instance > > (defun factorial (n) > (cond [(= n 0) 1] > [(> n 0) (* n (fact (- n 1)))] > )) This gets somewhat off-topic now, but just for completeness, let me mention that one can easily modify the ANSI CL reader in such a way that some characters are handled by custom code, and just make [] or even {} behave as if they also were (). This works for every ANSI-compliant CL. (Not that I would recommend this in any way.) I see the attempt to learn ocaml as a first step to understand Lisp with somewhat mixed feelings. (Even though right now, I teach it for more or less just that reason...) Certainly, it is very useful in many situations to know some OCaml, but if one just wants to learn Lisp, but is too spoilt by some syntax-rich languages that the uniformity of Lisp's parens turns out to be a problem, it might or might not be more appropriate to instead start with a LISP with a bit more syntactic sugar on top of it, which can use reader-dispatch to parse blocks of semicolon-delimited infix statements... -- regards, tf@cip.physik.uni-muenchen.de (o_ Thomas Fischbacher - http://www.cip.physik.uni-muenchen.de/~tf //\ (lambda (n) ((lambda (p q r) (p p q r)) (lambda (g x y) V_/_ (if (= x 0) y (g g (- x 1) (* x y)))) n 1)) (Debian GNU)