caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Dave Berry <dave@kal.com>
To: Pierre Weis <Pierre.Weis@inria.fr>
Cc: caml-list@inria.fr
Subject: RE: CamlTk and LablTk
Date: Thu, 1 Jun 2000 17:44:37 +0100	[thread overview]
Message-ID: <3145774E67D8D111BE6E00C0DF418B6623BCEE@nt.kal.com> (raw)

(I hope you don't mind me replying to a fairly old message).

This was a very interesting question, and the examples that Pierre included
were illuminating.  Would it be possible to elucidate a little further?  In
particular, I'd appreciate it if someone could give the types of the
relevant functions in each library.  (At some point one has to look at the
documentation for all the details, but this seems like a reasonably
educational example to take a little further).

Let's compare the two calls to create_oval.  First the Caml/TK:
      Canvas.create_oval c
        (Pixels (cx - wx)) (Pixels (cy - wy))
        (Pixels (cx + wx)) (Pixels (cy + wy))
        [Outline (NamedColor "black"); Width (Pixels 7);
         FillColor (NamedColor "white")]
Second the Labl/TK:
    Canvas.create_oval
        ~x1:(cx - wx) ~y1:(cy - wy)
        ~x2:(cx + wx) ~y2:(cy + wy) 
        ~outline: `Black ~width: 7
        ~fill: `White

It seems that Labl/TK is using labels in two ways.  First, to have named
arguments, so that you can see which position is x1, which is y1, etc.
Second, to handle optional arguments.  Where Caml/TK takes a list of
attributes, Labl/TK takes extra parameters.  I assume that this is where
Labl/TK has better type checking.  Does the type of each function list the
optional parameters that it may take?  : Doesn't this lead to large types
for each function? (I don't know O'Labl at all well).

Dave.




             reply	other threads:[~2000-06-03  7:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-01 16:44 Dave Berry [this message]
2000-06-03  8:16 ` Pierre Weis
  -- strict thread matches above, loose matches on Subject: below --
2000-05-18 17:37 Georges MARIANO
2000-05-22 14:57 ` Pierre Weis

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=3145774E67D8D111BE6E00C0DF418B6623BCEE@nt.kal.com \
    --to=dave@kal.com \
    --cc=Pierre.Weis@inria.fr \
    --cc=caml-list@inria.fr \
    /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).