From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id A391CBC6B for ; Sat, 28 Jul 2007 06:33:40 +0200 (CEST) Received: from smtp.syd.people.net.au (smtp.syd.people.net.au [218.214.225.98]) by discorde.inria.fr (8.13.6/8.13.6) with SMTP id l6S4XYT0028339 for ; Sat, 28 Jul 2007 06:33:39 +0200 Received: (qmail 15806 invoked from network); 28 Jul 2007 04:33:41 -0000 Received: from unknown (HELO hendrix.mega-nerd.net) (218.214.64.136) by smtp.syd.people.net.au with SMTP; 28 Jul 2007 04:33:41 -0000 Received: from hendrix (hendrix [192.168.200.99]) by hendrix.mega-nerd.net (Postfix) with SMTP id 352442FEA1 for ; Sat, 28 Jul 2007 14:33:32 +1000 (EST) Date: Sat, 28 Jul 2007 14:33:32 +1000 From: Erik de Castro Lopo To: caml-list@inria.fr Subject: Re: [Caml-list] Void type? Message-Id: <20070728143332.825d3493.mle+ocaml@mega-nerd.com> In-Reply-To: References: Organization: Erik Conspiracy Secret Labs X-Mailer: Sylpheed 2.3.1 (GTK+ 2.10.11; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 46AAC71E.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 ocaml:01 simulate:01 val:01 val:01 viruses:98 wrote:01 unix:01 caml-list:01 caml:02 objective:02 float:03 unit:03 unit:03 let:03 Stefan Monnier wrote: > > Is there a void type in OCaml (i.e. a type which has no values), or a way to > simulate it? Yes, the unit type which is written "()". Objective Caml version 3.09.2 # let x = () ;; val x : unit = () Unit can also be returned from a function, and a function can have its input of type unit: # let f () = 3.141 ;; val f : unit -> float = Erik -- ----------------------------------------------------------------- Erik de Castro Lopo ----------------------------------------------------------------- "Unix and C are the ultimate computer viruses." -- Richard P Gabriel