Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Re: Warnings in ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1999-02-22 (17:09)
From: Michael Hicks <mwh@d...>
Subject: Re: Warnings in ocaml

> > 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?

Michael Hicks
Ph.D. Candidate, the University of Pennsylvania            mailto://
"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."