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 31F3DBB9C for ; Sun, 18 Sep 2005 16:25:21 +0200 (CEST) Received: from smtp6.wanadoo.fr (smtp6.wanadoo.fr [193.252.22.25]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j8IEPKOW017935 for ; Sun, 18 Sep 2005 16:25:21 +0200 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf0609.wanadoo.fr (SMTP Server) with ESMTP id C26D02400130 for ; Sun, 18 Sep 2005 16:25:20 +0200 (CEST) Received: from [81.53.214.45] (ANantes-154-1-59-45.w81-53.abo.wanadoo.fr [81.53.214.45]) by mwinf0609.wanadoo.fr (SMTP Server) with ESMTP id 540CD240012D; Sun, 18 Sep 2005 16:25:20 +0200 (CEST) X-ME-UUID: 20050918142520344.540CD240012D@mwinf0609.wanadoo.fr In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v728) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: Jonathan Roewen , caml-list@yquem.inria.fr Content-Transfer-Encoding: 7bit From: yoann padioleau Subject: Re: [Caml-list] lisp to ocaml Date: Sun, 18 Sep 2005 16:17:40 +0200 To: Thomas Fischbacher X-Mailer: Apple Mail (2.728) X-Miltered: at concorde with ID 432D78D0.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 parentheses:01 parentheses:01 syntax:01 factorial:01 parens:01 caml-list:01 beginner's:01 ocaml:01 beginners:01 bug:01 cip:98 cip:98 lambda:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: ** X-Spam-Status: No, score=2.2 required=5.0 tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS autolearn=disabled version=3.0.3 >> Just all the parentheses gets a bit confusing for a first >> look at lisp ;-) >> > > The trick is: > > (1) Do not look at the parentheses. Read and write code by > indentation. > > (2) Use a text editor that helps you with this. > > (3) paren-sensitive syntax highlighting is a great thing. > 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)))] )) > You will find the parens to be much less confusing once you learned > not to > look at them. :-) > > > -- > 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) > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > >