caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Patrick M Doane <patrick@watson.org>
To: Collin <cmonahan@yahoo.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Obj.magic and "coe"
Date: Sat, 26 Jan 2002 09:38:51 -0500 (EST)	[thread overview]
Message-ID: <20020126093216.L82934-100000@fledge.watson.org> (raw)
In-Reply-To: <20020126031559.31383.qmail@web13303.mail.yahoo.com>

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


      reply	other threads:[~2002-01-26 14:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-26  3:15 Collin
2002-01-26 14:38 ` Patrick M Doane [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020126093216.L82934-100000@fledge.watson.org \
    --to=patrick@watson.org \
    --cc=caml-list@inria.fr \
    --cc=cmonahan@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).