Re: Warnings in ocaml

From: Michael Hicks (mwh@dsl.cis.upenn.edu)
Date: Mon Feb 22 1999 - 16:06:40 MET


From: Michael Hicks <mwh@dsl.cis.upenn.edu>
Message-Id: <199902221506.KAA23257@codex.cis.upenn.edu>
Subject: Re: Warnings in ocaml
To: Xavier.Leroy@inria.fr (Xavier Leroy)
Date: Mon, 22 Feb 1999 10:06:40 -0500 (EST)
In-Reply-To: <19990222133655.46186@pauillac.inria.fr> from "Xavier Leroy" at Feb 22, 99 01:36:55 pm

> > I copied from SML and defined a procedure "ignore":
> > so now I would write:
> > ignore (f x y); ...
>
> I was considering adding this to the standard library, implemented in
> such a way that no function call actually takes place. It seems to
> strike a reasonable balance between the safety of the warning and the
> inconvenience of writing "let _ = ..."

This is a nit, but I've noticed that for the bytecode compiler that

let _ = foo() in ()

generates more instructions than for

foo(); ()

In particular, there is an extra "push" instruction (presumably for the
binding to _) in the former. Is there any way to avoid this instruction
given that we know the binding is not going to really occur?
Mike

-- 
Michael Hicks
Ph.D. Candidate, the University of Pennsylvania
http://www.cis.upenn.edu/~mwh            mailto://mwh@dsl.cis.upenn.edu
"I worked with an individual who plugged his power strip back into itself
and for the life of him could not understand why his computer would not
turn on."



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:20 MET