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 PAA00128; Sat, 26 Jan 2002 15:40:13 +0100 (MET) 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 PAA32440 for ; Sat, 26 Jan 2002 15:40:12 +0100 (MET) Received: from fledge.watson.org ([204.156.12.50]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g0QEeBv25418 for ; Sat, 26 Jan 2002 15:40:11 +0100 (MET) Received: from localhost (patrick@localhost) by fledge.watson.org (8.11.6/8.11.5) with ESMTP id g0QEcq887418; Sat, 26 Jan 2002 09:38:52 -0500 (EST) (envelope-from patrick@watson.org) Date: Sat, 26 Jan 2002 09:38:51 -0500 (EST) From: Patrick M Doane To: Collin cc: caml-list@inria.fr Subject: Re: [Caml-list] Obj.magic and "coe" In-Reply-To: <20020126031559.31383.qmail@web13303.mail.yahoo.com> Message-ID: <20020126093216.L82934-100000@fledge.watson.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk You need to use 'coe' if you want to pack two different kind of widgets in the same function call. For example, let b = Button.create ... let t = Text.create ... pack [coe b; coe t] You could think of 'coe' as a cast operator to a generic widget object. That way, all elements in the list have the same type and the typechecker is happy. Note that when only widget is being packed, it isn't needed. Hope that helps, Patrick On Fri, 25 Jan 2002, Collin wrote: > > Hello; > > I was trying to pick up labltk and looking at the example code and I'm > confused by this: > Tk.pack [coe b] > > When I change it to: > Tk.pack [b] > > It seems to work just as before. I see coe preceding the widgets in > pack calls throughout the labltk examples. I looked up coe in widget.ml > and it looks like some really deep manure. I have no idea what it > means. If someone tries to really explain it, I will have no idea what > they are talking about. Perhaps someone could just give me a hacker's > explanation of why it's in the pack calls. > > Thank you, > Collin Monahan > > ===== > "Better to light one candle than to curse the darkness" > "This little light of mine, I'm gonna let it shine" > SOAP (n) - A "Simple" protocol which requires a Master's degree to use. > > __________________________________________________ > Do You Yahoo!? > Great stuff seeking new owners in Yahoo! Auctions! > http://auctions.yahoo.com > ------------------- > Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ > 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/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr