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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id 2009A7EE94 for ; Fri, 28 Dec 2012 13:30:34 +0100 (CET) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of philippe.wang.lists@gmail.com) identity=pra; client-ip=209.85.212.170; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="philippe.wang.lists@gmail.com"; x-sender="philippe.wang.lists@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of philippe.wang.lists@gmail.com designates 209.85.212.170 as permitted sender) identity=mailfrom; client-ip=209.85.212.170; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="philippe.wang.lists@gmail.com"; x-sender="philippe.wang.lists@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wi0-f170.google.com) identity=helo; client-ip=209.85.212.170; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="philippe.wang.lists@gmail.com"; x-sender="postmaster@mail-wi0-f170.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmIKAKaQ3VDRVdSqk2dsb2JhbABFrl+PAAgWDgEBAQEJCQsJFAQjgh4BAQQBQAE4AQMBCwEFBQsDOCISAQUBHAYTiAEDCQaZIY8uhHgnDYhrAQUMjEsbhCgDjVSIOI5oFimBV4I/gWw X-IronPort-AV: E=Sophos;i="4.84,369,1355094000"; d="scan'208";a="166954013" Received: from mail-wi0-f170.google.com ([209.85.212.170]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 28 Dec 2012 13:30:04 +0100 Received: by mail-wi0-f170.google.com with SMTP id hq7so5086405wib.5 for ; Fri, 28 Dec 2012 04:30:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=I3NOxJT9i2aphb+bBGqAW1L1yJgeagpEhp9TpRpjvkk=; b=BEO7hwvBFikmlTTKadwiyccp6g6JZ/xadXHdeiyLncG/4SGY+J7wydw5uCx666y+Sp opI1r8tErYlHvak7875jSNo5fa4IJyfc2AqPJDMhmp4MV2ojdWrjlCLWx1XzHYOmpzqH IljwWP3HM/NQ5A0z6bHOjCdAZsLe/2rQYfZPgBR4ukO3YUsQ5yP0CYy5EYGza+DVAXZz iFtdsYutUPaTa95P0hVYLX2udXBKvPF8R6MlapSr23aYNavlSczJsdJaMPj3JF+g51ED k0Bjv3NqyXoBtg+xrsn3RqRkSiv64E+gMndO8h7zTCa7WNOnkYjShczy1snxKIsqSf4r gd8A== MIME-Version: 1.0 Received: by 10.180.75.208 with SMTP id e16mr52630594wiw.3.1356697803563; Fri, 28 Dec 2012 04:30:03 -0800 (PST) Sender: philippe.wang.lists@gmail.com Received: by 10.216.16.82 with HTTP; Fri, 28 Dec 2012 04:30:03 -0800 (PST) In-Reply-To: References: <50D59147.3000201@ssi.gouv.fr> Date: Fri, 28 Dec 2012 13:30:03 +0100 X-Google-Sender-Auth: p93B1IRhuip12yIbgxmzNhvTFNY Message-ID: From: Philippe Wang To: Peter Frey Cc: "Eric Jaeger (ANSSI)" , OCaml Mailing List Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Caml-list] Function returning recursive lists 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