Version française
Home     About     Download     Resources     Contact us    
Browse thread
optimizing trivial functions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Sean McLaughlin <seanmcl@c...>
Subject: Re: [Caml-list] optimizing trivial functions

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
>