From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id 721F07EE94 for ; Fri, 4 Jan 2013 01:45:44 +0100 (CET) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of berenger@riken.jp) identity=pra; client-ip=134.160.33.161; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="berenger@riken.jp"; x-sender="berenger@riken.jp"; x-conformance=sidf_compatible Received-SPF: Pass (mail1-smtp-roc.national.inria.fr: domain of berenger@riken.jp designates 134.160.33.161 as permitted sender) identity=mailfrom; client-ip=134.160.33.161; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="berenger@riken.jp"; x-sender="berenger@riken.jp"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: Pass (mail1-smtp-roc.national.inria.fr: domain of postmaster@postman.riken.jp designates 134.160.33.161 as permitted sender) identity=helo; client-ip=134.160.33.161; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="berenger@riken.jp"; x-sender="postmaster@postman.riken.jp"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ak8CAAsl5lCGoCGhkWdsb2JhbABFhjqkSJJkDgEBAQEUEhQngh4BAQQBIxU2CgYLCxgCAgUEEgsCAgkDAgECATMSEwYCAQEOh28DCQYMpxeIVwOGbYEiizUbf4IWgRMDiGCNLIEchE+NYIFi X-IronPort-AV: E=Sophos;i="4.84,406,1355094000"; d="scan'208";a="188399997" Received: from postman1.riken.jp (HELO postman.riken.jp) ([134.160.33.161]) by mail1-smtp-roc.national.inria.fr with ESMTP; 04 Jan 2013 01:45:42 +0100 Received: from postman.riken.jp (postman1.riken.jp [127.0.0.1]) by postman.riken.jp (Postfix) with SMTP id 3599032C01E4 for ; Fri, 4 Jan 2013 09:45:39 +0900 (JST) Received: from [172.27.98.103] (rikad98.riken.jp [134.160.214.98]) by postman.riken.jp (Postfix) with ESMTPA id 65B4632A0047 for ; Fri, 4 Jan 2013 09:45:38 +0900 (JST) Message-ID: <50E62632.4060208@riken.jp> Date: Fri, 04 Jan 2013 09:45:38 +0900 From: Francois Berenger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: caml-list@inria.fr References: <50D59147.3000201@ssi.gouv.fr> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.6.0.2009776, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.1.4.3325 Subject: Re: [Caml-list] Function returning recursive lists On 12/29/2012 12:22 AM, Didier Cassirame wrote: > Hi all, > > Regarding the original question, wouldn't it be easier to implement it > as a stream? It smells as someone needs a stream or a lazy list indeed. Happy new year! ;) > didier > > 2012/12/28, Philippe Wang : >> On Fri, Dec 28, 2012 at 2:41 AM, Peter Frey wrote: >> >>> The problem with docycle is not its coding style but that it produces in >>> fact a cyclic list, which is not very useful: Almost all functions, such >>> as List.rev are undefined. >> >> From my point of view, this coding style is fundamentally *wrong*: >> - it makes assumptions on the internal data representation, >> - and it prevents the compiler from making any optimisation from the >> fact that elements of built-in lists are immutable (and if the >> compilers makes some optimisations from that fact, then it's not only >> the style but the program that is wrong). >> >> Cheers, >> >> -- >> Philippe Wang >> mail@philippewang.info >> >> -- >> Caml-list mailing list. Subscription management and archives: >> https://sympa.inria.fr/sympa/arc/caml-list >> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners >> Bug reports: http://caml.inria.fr/bin/caml-bugs >> >