From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q27F02Nh002953 for ; Wed, 7 Mar 2012 16:00:06 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApkDAJV3V0/RVda2kGdsb2JhbABDgwmwfgKBBggiAQEBAQkJDQcUBCOCCgEBAQQSAiQIARscAgMMBgULDQkWDwkDAgECARERAQUBHBMIAQEeh2abUQqLdIJxhU4/iHQBBQuMJYEdgyIEiFKMb4VkgTqHGz2EIg X-IronPort-AV: E=Sophos;i="4.73,545,1325458800"; d="scan'208";a="134859395" Received: from mail-tul01m020-f182.google.com ([209.85.214.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 07 Mar 2012 16:00:05 +0100 Received: by mail-tul01m020-f182.google.com with SMTP id wc7so13689275obb.27 for ; Wed, 07 Mar 2012 07:00:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=fnnkl5Ad2SqTC9rIQINVacJwT4WhBJSABwe7vJWbzOA=; b=r7ngqwXgQYJkRlLj4fX/39jGaavaYx5cxqFCnFRNqteqtxsWF5CywWw84KvdQsVRM9 QmHcAMB1yBjB9mkwdZH8qAbQOP1zrb2crQHrQe8M1C7YRf8ub4EIrbGBvYRhy1ruRWqz xCWlddD6HKBeAF5u+gt8K4hwpkCzF+PpWOiQ8lVelFyLGvBVdz8Fv1Crvwuu5MWvyeUo EFZP/6KBiMYeH4445hnvamB1m0F52nDf/yUj+yW+xKLQsuwTOBsSt68h03KPiFapAwXF zXJ8bppM+AE+srZRQ+YECS9jdaXmN0dNL8mxc34BqSzmc0tuntsTPozZgEQHtiho3VRy LMyQ== Received: by 10.182.8.69 with SMTP id p5mr936362oba.28.1331132405410; Wed, 07 Mar 2012 07:00:05 -0800 (PST) Received: from [192.168.1.65] (99-121-78-10.lightspeed.lnngmi.sbcglobal.net. [99.121.78.10]) by mx.google.com with ESMTPS id n1sm22385833obm.11.2012.03.07.07.00.03 (version=SSLv3 cipher=OTHER); Wed, 07 Mar 2012 07:00:04 -0800 (PST) Message-ID: <4F5777F2.2000806@gmail.com> Date: Wed, 07 Mar 2012 10:00:02 -0500 From: Edgar Friendly User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: caml-list@inria.fr References: <87sjhktqwi.fsf@frosties.localnet> In-Reply-To: <87sjhktqwi.fsf@frosties.localnet> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Can one implement greedy/inline data structures in ocaml? On 03/07/2012 09:41 AM, Goswin von Brederlow wrote: > The task then needs pointers to each of the lists data > structures creating cycles. Not good for ocaml. It also would waste > memory for 2 pointers (per list). Cycles are fine for ocaml, pointers are pretty cheap, and I think the answer to your question is no - there's a regularity to values that's required by the garbage collector, and what you seem to want is the ability to inline nested structures without pointers, and OCaml's data representation doesn't allow this, mainly because of the tag word needed by the GC. Beware premature optimization. E.