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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id E60687EE51 for ; Sat, 6 Apr 2013 10:02:21 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of syshen@nudt.edu.cn) identity=pra; client-ip=61.187.54.11; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="syshen@nudt.edu.cn"; x-sender="syshen@nudt.edu.cn"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of syshen@nudt.edu.cn) identity=mailfrom; client-ip=61.187.54.11; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="syshen@nudt.edu.cn"; x-sender="syshen@nudt.edu.cn"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@nudt.edu.cn) identity=helo; client-ip=61.187.54.11; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="syshen@nudt.edu.cn"; x-sender="postmaster@nudt.edu.cn"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: As4HACDVX1E9uzYLdGdsb2JhbABQhma9T4E/DgEMFQg8ghaBHgkBQIEDiAKTFIwyjkwIiSmJEY84ghOBFwOIeo10lCWCGw X-IPAS-Result: As4HACDVX1E9uzYLdGdsb2JhbABQhma9T4E/DgEMFQg8ghaBHgkBQIEDiAKTFIwyjkwIiSmJEY84ghOBFwOIeo10lCWCGw X-IronPort-AV: E=Sophos;i="4.87,420,1363129200"; d="scan'208";a="12072647" Received: from mail.nudt.edu.cn (HELO nudt.edu.cn) ([61.187.54.11]) by mail2-smtp-roc.national.inria.fr with ESMTP; 06 Apr 2013 10:02:19 +0200 Received: by ajax-webmail-coremail.nudt.edu.cn (Coremail) ; Sat, 6 Apr 2013 15:59:21 +0800 (GMT+08:00) Date: Sat, 6 Apr 2013 15:59:21 +0800 (GMT+08:00) From: =?GBK?B?yfLKpNPu?= To: caml-list@inria.fr Message-ID: <388323f0.3cf7.13dde5b5ae6.Coremail.syshen@nudt.edu.cn> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_53941_1313553587.1365235161830" X-Originating-IP: [113.246.242.206] X-Priority: 3 X-Mailer: Coremail Webmail Server Version 4.0.5a build 20121109(20529.5019.5013) Copyright (c) 2002-2013 www.mailtech.cn nudt-out X-SendMailWithSms: false X-CM-TRANSID:AQAAf0A5f0Ta1V9RitEZAA--.3960W X-CM-SenderInfo: xv1vxvnq6q3vvwohv3gofq/1tbiAQAOE1C8Ui+dggA+ss X-Coremail-Antispam: 1Ur529EdanIXcx71UUUUU7IcSsGvfJ3iIAIbVAYjsxI4VWxJw CS07vEb4IE77IF4wCS07vE1I0E4x80FVAKz4kxMIAIbVAFxVCaYxvI4VCIwcAKzIAtYxBI daVFxhVjvjDU= Subject: [Caml-list] [CAML liist] :: how to reduce depply recursive ocaml program's memory usage ------=_Part_53941_1313553587.1365235161830 Content-Type: text/plain; charset=GBK Content-Transfer-Encoding: 7bit Dear all: I have a deeply recursive ocaml program in the following way: method A begin calling B end method B begin calling A end in A and B, there are lots of local let bindings liek: let c=... in let d=f(c) so by changing it to let d= begin let c = ... in f(c) end can I reduce the memory usage? Shen ------=_Part_53941_1313553587.1365235161830 Content-Type: text/html; charset=GBK Content-Transfer-Encoding: 7bit Dear all:

I have a deeply recursive ocaml program in the following way:

method A begin
calling B
end

method B begin 
calling A
end


in A and B, there are lots of local let bindings liek:

let c=... in
let d=f(c)

so by changing it to

let d= begin
 let c = ... in
 f(c)
end

can I reduce the memory usage?

Shen
------=_Part_53941_1313553587.1365235161830--