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 GAA22981; Thu, 26 Aug 2004 06:19:00 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id GAA21404 for ; Thu, 26 Aug 2004 06:18:59 +0200 (MET DST) Received: from smtp800.mail.sc5.yahoo.com (smtp800.mail.sc5.yahoo.com [66.163.168.179]) by concorde.inria.fr (8.13.0/8.13.0) with SMTP id i7Q4IvNS012765 for ; Thu, 26 Aug 2004 06:18:58 +0200 Received: from unknown (HELO Vigo) (alexandervaldez@sbcglobal.net@68.94.0.54 with login) by smtp800.mail.sc5.yahoo.com with SMTP; 26 Aug 2004 04:18:57 -0000 From: "Alex Valdez" To: , Subject: RE: [Caml-list] baffled by semicolon Date: Wed, 25 Aug 2004 23:18:52 -0500 Message-ID: <000401c48b23$cc26d630$0200a8c0@Vigo> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 In-Reply-To: <16685.22393.76718.150882@soggy.deldotd.com> Importance: Normal X-Miltered: at concorde with ID 412D64B1.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 baffled:01 semicolon:01 semicolon:01 separates:01 semicolons:01 2004:99 caml-list:01 baffled:01 lablgtk:01 gwindow:01 gmisc:01 bug:01 faq:01 faq:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk The semicolon separates a series of expressions. The value of a series of expressions separated by semicolons is the value of the last expression. Every expression except the last must evaluate to unit. The following code snippet let w = area#misc#realize () ; area#misc#window;; is the same as let w = area#misc#realize ( () ; area#misc#window );; which is the same as let w = area#misc#realize area#misc#window;; -----Original Message----- From: owner-caml-list@pauillac.inria.fr [mailto:owner-caml-list@pauillac.inria.fr]On Behalf Of briand@aracnet.com Sent: Wednesday, August 25, 2004 10:23 PM To: caml-list@pauillac.inria.fr Subject: [Caml-list] baffled by semicolon 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 ------------------- 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