From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id FAA21034; Thu, 26 Aug 2004 05:22:37 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 FAA21662 for ; Thu, 26 Aug 2004 05:22:36 +0200 (MET DST) From: briand@aracnet.com Received: from jade.spiritone.com (jade.spiritone.com [216.99.193.136]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id i7Q3MY5D007459 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 26 Aug 2004 05:22:35 +0200 Received: from soggy.deldotd.com (216-99-206-32.cust.aracnet.com [216.99.206.32]) by jade.spiritone.com (8.12.8/8.12.8) with ESMTP id i7Q3MXoR027318 for ; Wed, 25 Aug 2004 20:22:33 -0700 Received: from briand by soggy.deldotd.com with local (Exim 3.36 #1 (Debian)) id 1C0AqP-0000MV-00 for ; Wed, 25 Aug 2004 20:22:33 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16685.22393.76718.150882@soggy.deldotd.com> Date: Wed, 25 Aug 2004 20:22:33 -0700 To: caml-list@pauillac.inria.fr Subject: [Caml-list] baffled by semicolon X-Mailer: VM 6.92 under Emacs 21.2.1 X-Miltered: at nez-perce with ID 412D577A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; baffled:01 semicolon:01 lablgtk:01 gwindow:01 gmisc:01 semicolon:01 ocaml:01 width:98 height:98 syntax:02 unit:03 obj:03 let:04 let:04 gdk:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk This might really by a lablgtk2 question, but I thought it's probably more of a ocaml syntax question : The following works : let window = GWindow.window ~width:400 ~height:400() ;; let area = GMisc.drawing_area ~packing:window#add () ;; let w = area#misc#realize () ; area#misc#window;; let drawing = new GDraw.drawable w ;; However making the simple change let w = area#misc#realize () ;; ^^ notice the double semicolon gives an error: This expression has type unit but is here used with type [> `drawable ] Gobject.obj For the simple reason that w has somehow, mysteriously, become = () instead of Gdk.window which is the value it would acquire if it was only a single semi-colon. I went back through the manual and really couldn't find anything which explained the difference between ; and ;; - so it's not at all obvious to me what's going on here. I would think that w would take on the value of evaluating area#misc#realize () in either case. ??? Brian ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners