From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 9A281BCF9 for ; Mon, 27 Nov 2006 09:39:51 +0100 (CET) Received: from smtp.andrew.cmu.edu (smtp.andrew.cmu.edu [128.2.10.83]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id kAQDaAc4002518 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sun, 26 Nov 2006 14:36:12 +0100 Received: from [71.199.122.9] (c-71-199-122-9.hsd1.pa.comcast.net [71.199.122.9]) (user=seanmcl mech=PLAIN (0 bits)) by smtp.andrew.cmu.edu (8.13.6/8.13.6) with ESMTP id kAQDa9Wf005632 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT); Sun, 26 Nov 2006 08:36:10 -0500 In-Reply-To: <6BDD3772-05B7-41DD-B36C-B2CBB0D4B388@cmu.edu> References: <6BDD3772-05B7-41DD-B36C-B2CBB0D4B388@cmu.edu> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <8701A805-C71D-4CC0-BAE1-7EFEF5D50B61@cmu.edu> Cc: caml-list@inria.fr Content-Transfer-Encoding: 7bit From: Sean McLaughlin Subject: Re: [Caml-list] optimizing trivial functions Date: Sun, 26 Nov 2006 08:36:07 -0500 To: Sean McLaughlin X-Mailer: Apple Mail (2.752.2) X-Scanned-By: MIMEDefang 2.57 on 128.2.10.83 X-Miltered: at discorde with ID 4569984A.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; trivial:01 haskell:01 ocaml:01 compiler:01 beginner's:01 ocaml:01 bug:01 beginners:01 wrote:01 caml-list:01 caml-list:01 functions:01 bin:01 int:01 caml:02 To answer my own question, of course it can't do that, because the arguments could have side effects. I wonder if Haskell would do this... Sean f (print_int 5) ... On Nov 21, 2006, at 6:20 PM, Sean McLaughlin wrote: > Hello, > > Will the Ocaml compiler optimize the following code to let y = ()? > I'm designing a program that will depend heavily on whether this code > is optimized in this way. > > let f x1 x2 ... x100 = () > let y = f x1 ... x100 > > Thanks, > > Sean > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >