From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA27032 for caml-redistribution; Wed, 23 Dec 1998 16:03:19 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id FAA27026 for ; Wed, 23 Dec 1998 05:14:58 +0100 (MET) Received: from mx.seanet.com (dns2.seanet.com [199.181.164.2]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id FAA27410 for ; Wed, 23 Dec 1998 05:14:56 +0100 (MET) Received: from mmuncher4 (h24.dialup.seanet.com [207.12.129.120]) by mx.seanet.com (8.8.8/Seanet-8.7.3) with SMTP id JAA02569 for ; Mon, 21 Dec 1998 09:13:39 -0800 (PST) Message-Id: <3.0.32.19981221091704.00bcd310@seanet.com> X-Sender: dwight@seanet.com X-Mailer: Windows Eudora Pro Version 3.0 (32) Date: Mon, 21 Dec 1998 09:17:06 -0800 To: caml-list@inria.fr From: Dwight VandenBerghe Subject: how to coerce expression type? Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: weis I am converting older ocaml code to version 2.01, and find that many expressions that passed through the previous compilers fine now exhibit warning errors due to not being of unit type. This happens when I evaluate an expression for its side effects (the horror, the horror). Here's an example: let is_in_table table key = try Hashtbl.find table key; true with Not_found -> false;; I don't want the result back from the lookup, I just want to know if the key was present. So how do I "cast" the find operation to unit, to quiet the warnings? I've tried everything I can think of, things like (Hashtbl.find table key) : () but have not yet hit upon the magic incantation. Thank you. Dwight