Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Sean McLaughlin <seanmcl@cmu.edu>
To: Sean McLaughlin <seanmcl@cmu.edu>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] optimizing trivial functions
Date: Sun, 26 Nov 2006 08:36:07 -0500	[thread overview]
Message-ID: <8701A805-C71D-4CC0-BAE1-7EFEF5D50B61@cmu.edu> (raw)
In-Reply-To: <6BDD3772-05B7-41DD-B36C-B2CBB0D4B388@cmu.edu>


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
>


  reply	other threads:[~2006-11-27  8:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-21 23:20 Sean McLaughlin
2006-11-26 13:36 ` Sean McLaughlin [this message]
2006-11-27 12:00   ` [Caml-list] " Dmitry Bely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8701A805-C71D-4CC0-BAE1-7EFEF5D50B61@cmu.edu \
    --to=seanmcl@cmu.edu \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox