caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] baffled by semicolon
@ 2004-08-26  3:22 briand
  2004-08-26  3:30 ` David Brown
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: briand @ 2004-08-26  3:22 UTC (permalink / raw)
  To: caml-list


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-08-30 11:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-26  3:22 [Caml-list] baffled by semicolon briand
2004-08-26  3:30 ` David Brown
2004-08-26  4:18 ` Alex Valdez
2004-08-26  5:05   ` briand
2004-08-29  4:45     ` William Lovas
2004-08-30  7:12 ` Baffeld by manual (Was: [Caml-list] baffled by semicolon) Florian Hars
2004-08-30  8:06   ` skaller
2004-08-30  8:23     ` Radu Grigore
2004-08-30  8:25     ` Ville-Pertti Keinonen
2004-08-30 11:07       ` skaller

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).