From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 27348BCAF for ; Mon, 18 Jul 2005 17:27:57 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j6IFRu3n031769 for ; Mon, 18 Jul 2005 17:27:56 +0200 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 RAA00460 for ; Mon, 18 Jul 2005 17:27:56 +0200 (MET DST) Received: from alex.barettalocal.com (h213-255-109-130.albacom.net [213.255.109.130] (may be forged)) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j6IFRtjX031764 for ; Mon, 18 Jul 2005 17:27:55 +0200 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by alex.barettalocal.com (Postfix) with ESMTP id A37242BAA98; Mon, 18 Jul 2005 17:26:15 +0200 (CEST) Message-ID: <42DBCA16.3000002@barettadeit.com> Date: Mon, 18 Jul 2005 17:26:14 +0200 From: Alex Baretta User-Agent: Debian Thunderbird 1.0.2 (X11/20050331) X-Accept-Language: en-us, en MIME-Version: 1.0 To: alphablock , Ocaml Subject: Re: [Caml-list] (Mostly) Functional Design? References: <9cc3782b05071411004b27b6a4@mail.gmail.com> <42DB6161.4030507@cs.utah.edu> <006801c58ba4$0b7bfe60$322cf8c1@oemcomputer> In-Reply-To: <006801c58ba4$0b7bfe60$322cf8c1@oemcomputer> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 42DBCA7C.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 42DBCA7B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; baretta:01 caml-list:01 damien:01 trivial:01 recursion:01 recursive:01 iterator:01 iterator:01 late-binding:01 recursive:01 multi-stage:01 parametrized:01 abstracting:01 baretta:01 ...:98 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.2 X-Spam-Level: alphablock wrote: > May be there are many less FP solutions than OOP solutions just because > there are many less FP problems than OOP problems. > > Or may be i am plain naive, who knows... > > - damien I would not say so. It is just the problems tend to admit a fairly simple--although generally not trivial solution. This does not justify a large scale attempt to catalog all FP "design patterns" in a single book. Let me try to list a few I can readily think of. * Indefinite recursion through tail call optimization * Systematic elimination of explicit or implicit (recursive) cycles whenever an iterator is available. If an iterator is not available for a given data structure, it is often advisable to define one. * Order preservation of sequential data structures such as lists through the use of an even number of order reversing tail-recursive algorithms. * Late-binding of recursive calls * Multi-stage programming through partial evaluation ... These ideas are more general coding strategies requiring a specific design from the programmer, rather than parametrized design patterns abstracting from the (absence of) cognitive abilities of the programmer. Alex -- ********************************************************************* http://www.barettadeit.com/ Baretta DE&IT A division of Baretta SRL tel. +39 02 370 111 55 fax. +39 02 370 111 54 Our technology: The Application System/Xcaml (AS/Xcaml) The FreerP Project