flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.0 out now! Get yours from http://caml.inria.fr/ocaml/release.html
nicolas__ has joined #ocaml
vpalle_ has quit [Read error: 110 (Connection timed out)]
glondu has quit [Read error: 60 (Operation timed out)]
glondu has joined #ocaml
nicolas__ has quit ["Ex-Chat"]
vixey has quit [Connection timed out]
mpeter has quit [Connection timed out]
vpalle_ has joined #ocaml
alexyk has joined #ocaml
vpalle_ has quit [Read error: 110 (Connection timed out)]
jeddhaberstro has quit [Connection reset by peer]
jeddhaberstro has joined #ocaml
vpalle_ has joined #ocaml
mpeter has joined #ocaml
vpalle_ has quit [Read error: 110 (Connection timed out)]
hkBst has quit [Remote closed the connection]
love-pingoo has quit ["Connection reset by pear"]
Amorphous has quit [Operation timed out]
Amorphous has joined #ocaml
mpeters has joined #ocaml
mpeter has quit [Success]
alexyk has quit []
alexyk has joined #ocaml
alexyk has quit []
dfritz_ has joined #ocaml
snhmib has quit ["Good riddance!"]
Associat0r has quit []
alexyk has joined #ocaml
alexyk_ has joined #ocaml
mpeters has quit [Read error: 110 (Connection timed out)]
alexyk__ has joined #ocaml
dfritz has quit [Read error: 110 (Connection timed out)]
jeddhaberstro has quit []
alexyk has quit [Connection timed out]
alexyk_ has quit [Read error: 110 (Connection timed out)]
gaze__ has joined #ocaml
<gaze__> what's the proper way to compose a string from a formatting?
<gaze__> like, I'm looking for the function x where x "%s %s" "a" "b" == "a b"
dfritz_ has quit [Read error: 54 (Connection reset by peer)]
det has quit [Remote closed the connection]
<thelema> gaze__: Printf.sprintf
det has joined #ocaml
det has quit [Remote closed the connection]
mpeter has joined #ocaml
det has joined #ocaml
ikaros has joined #ocaml
slash_ has quit [Read error: 110 (Connection timed out)]
alexyk__ has quit []
olgen has joined #ocaml
ademix has joined #ocaml
<flux> does jocaml need to exactly match my ocaml version? Warning: Version mismatch ocaml is 3.11.1+dev0 (2008-12-03), jocaml is 3.11.0
Yoric[DT] has joined #ocaml
<flux> (although I do wonder why I have that, because I checked out release311 from cvs - apparently it's a branch, not a tag?)
mpeter has quit [Read error: 60 (Operation timed out)]
<flux> (or maybe the versioning in godi's cvs ocaml doesn't have necessary special handling for real release tags)
<Yoric[DT]> hi
mpeter has joined #ocaml
<flux> hcarty, is there something that stops one from passing Marshal'd values with jocaml? with its closure support, obviously :)
<flux> in the case one can know each node has the same executable running..
<Yoric[DT]> Iirc, with old-style JoCaml, there was more to it than just Marshaling. There was also a degree of dynamic linking.
<Yoric[DT]> (on unmarshal)
<flux> hmm
<flux> ah, right, first I read you were talking about plain OCaml
<flux> and that would be very nice
<flux> but while we don't have it, an alternative is nice to have :)
<flux> if ocaml itself was ever to support marshalling into different versions of the same program, I would imagine Jocaml could just make use of that feature directly
<Yoric[DT]> :)
* Yoric[DT] wonders if development of Acute is still proceeding.
<flux> atleast the latest white paper marked 'new' in the page is from Apr 2007..
<flux> so perhaps
gdmfsob has joined #ocaml
<flux> but it's been a while
<flux> it seems jocaml is moving quite nicely, though
_zack has joined #ocaml
ikaros has quit [".quit"]
Yoric[DT] has quit ["Ex-Chat"]
johnnowak has joined #ocaml
<flux> another issue with jocaml appears to be exceptions, but there's a decent workaround. perhaps the most important issue (before or after code mobility?) is the lack of type safety, even at runtime :/
<flux> perhaps a 'lint' like solution could be deviced for the latter problem
<flux> that's of course my opinion before actually trying it out :-)
seafood has quit []
vpalle_ has joined #ocaml
munga` has joined #ocaml
marmotine has joined #ocaml
_zack has quit ["Leaving."]
munga has quit [Read error: 110 (Connection timed out)]
vpalle_ has quit [Read error: 60 (Operation timed out)]
mfp has quit [Read error: 104 (Connection reset by peer)]
LaFrite has left #ocaml []
mfp has joined #ocaml
_zack has joined #ocaml
gaze__ has quit []
vpalle has joined #ocaml
OChameau has joined #ocaml
_zack has quit ["Leaving."]
_zack has joined #ocaml
ademix has quit ["Quitte"]
fschwidom has joined #ocaml
Associat0r has joined #ocaml
buzz0r has joined #ocaml
<buzz0r> Hi! Someone ever used glade with ocaml (labltkg2) ? Im a ocaml newbie and dont know how to use the generated ocaml class by lablglade2cc to get something displayed.
<buzz0r> The samples in the ubuntu package are (yet) too sophisticated
<buzz0r> a simple hell world button would to
<buzz0r> can someone help me?
<buzz0r> would do.. sry.. misstyped :)
<flux> I remember trying glade out quite some time ago and found it working, but that's about it.. and I can't find the stuff I played with.
<flux> sorry :)
<buzz0r> ok, so what do use now? Handcoded guis? or the ruby,tcl/tk,python or perl wrappers with its tools and extentiions?
<flux> I would either pursue looking into glade, or hand-code
<flux> what kind of gui project do you have in mind?
<flux> unfortunately the gtk binding documentation will at times require looking at the original gtk documentation, unless you're well versed with it already
<buzz0r> little window with a "ok" button in the middle. when pressing the button it should show a gtk windows with a label "hello world"
<buzz0r> oh ok, thanks for the hint!
<buzz0r> actually im playing with "rocaml" in comibation with "shoes" (the gui toolkit)
<flux> how does that go?
<buzz0r> it works
<buzz0r> very smooth, so I guess using ruby/gtk with glade in combination with rocaml would do too
<buzz0r> however, if you ever find your old files that used glade with ocaml, leav me a hint :)
<flux> were the glade files called *.glade?
<buzz0r> yes.
<buzz0r> The step i am failing at, is when integration the generated ocaml glade-class
<buzz0r> i know i have to inheritc this class
<buzz0r> for the main application
Saizan has joined #ocaml
<buzz0r> sry for my tipos
<flux> did a new search armed with that piece of information: sorry, no go
<buzz0r> class window1 ?domain ?autoconnect(*=true*) () =
<buzz0r> let xmldata = Glade.create ~data ~root:"window1" ?domain () in
<buzz0r> object (self)
<buzz0r> inherit Glade.xml ?autoconnect xmldata
<buzz0r> val toplevel =
<buzz0r> new GWindow.window (GtkWindow.Window.cast
<buzz0r> (Glade.get_widget_msg ~name:"window1" ~info:"GtkWindow" xmldata))
Kerris7 has joined #ocaml
<buzz0r> method toplevel = toplevel
<buzz0r> val window1 =
<buzz0r> new GWindow.window (GtkWindow.Window.cast
<buzz0r> (Glade.get_widget_msg ~name:"window1" ~info:"GtkWindow" xmldata))
<flux> a paste site might be more appreciated..
<buzz0r> method window1 = window1
<buzz0r> val hbox1 =
<buzz0r> new GPack.box (GtkPack.Box.cast
<buzz0r> (Glade.get_widget_msg ~name:"hbox1" ~info:"GtkHBox" xmldata))
<buzz0r> method hbox1 = hbox1
<buzz0r> val button2 =
<buzz0r> new GButton.button (GtkButton.Button.cast
<buzz0r> (Glade.get_widget_msg ~name:"button2" ~info:"GtkButton" xmldata))
<buzz0r> method button2 = button2
<buzz0r> val button1 =
<buzz0r> new GButton.button (GtkButton.Button.cast
<buzz0r> (Glade.get_widget_msg ~name:"button1" ~info:"GtkButton" xmldata))
<buzz0r> method button1 = button1
<buzz0r> method reparent parent =
<buzz0r> hbox1#misc#reparent parent;
<buzz0r> toplevel#destroy ()
<buzz0r> method check_widgets () = ()
<buzz0r> end
<buzz0r> :)
<buzz0r> sry for this
<buzz0r> but maybe it reminds you a little bit
<buzz0r> i know
<buzz0r> sry
<flux> so why doesn't that work?
<buzz0r> will never do it again
<buzz0r> its just the class (window1)
<buzz0r> now i need to inherit the class (window1)
Saizan has left #ocaml []
johnnowak has quit []
<buzz0r> into a "main" program and do stuff like "Gtk.main.main(run)" I think
<flux> well, hang around on the channel, perhaps someone more familiar with glade&ocaml can give you a hand
<flux> in the meanwhile perhaps trying to figure out the examples is useful :)
<buzz0r> yep, I will keep on trying :). By the way.. is there a ocaml wiki ? If I figure it out, i'd like to contirubte it back. (and at least there would be place to find things again :) )
<flux> there is ocaml-tutorial.org
<buzz0r> ok thanks
<Kerris7> I'm trying to do some Essentials of Programming Languages exercises in OCaml
<Kerris7> and I wrote this to count the occurrences of 's' in 'slist' http://ocaml.pastebin.com/m57bc1af0
<Kerris7> how would I match for nested lists?
<Kerris7> as it is the program doesn't count occurrences of 's' if they exist in a list that is nested inside 'slist'
<flux> let countoccurrances2 s slist = List.fold_left (fun n l -> n + countoccurrances s l) 0 slist
<flux> you cannot write a single function that counts the number of occurrances in both 'a list and 'a list list, atleast without more accurately parametrizing what you're looking for
<Kerris7> thanks flux :(
<flux> (of course if you have a list that might have elements or sublists, you need to write a new type, such as: type 'a list_or_element = Element of 'a | List of 'a list_or_element list)
<Kerris7> ah, the OCaml way
snhmib has joined #ocaml
ademix has joined #ocaml
Snark has joined #ocaml
ademix has quit [Read error: 104 (Connection reset by peer)]
cygnus_ has quit [Read error: 110 (Connection timed out)]
<buzz0r> ok, i made some progress. now i have a gtk button saying hello world when clicked. I did it with Glade and converteted it to ocaml code with lablglade2cc
<buzz0r> however, back to basics :)
<buzz0r> Whats the meaning of : object (self)
<buzz0r> ?
<flux> what part of it in particular? (self) ?
<buzz0r> class editor () =
<buzz0r> object (self)
<buzz0r> inherit window1 ()
<flux> plain 'object' is just part of the syntax that defines an object, in this for a class
<flux> if you have (self), self is the 'this' value of the object
<flux> so if it ever needs to refer to itself, it can use that to do that
<buzz0r> ok, if I would have the method "foobar" i could call it like:
<buzz0r> self.foobar ?
<xevz> self#foobar
<buzz0r> thanks! So this implies i can only have one "self" object in a program?
<flux> well, one 'self' per object
<flux> self is accessible only from within the object
<buzz0r> ah ok
<buzz0r> that make sense
<buzz0r> makes.. damn tipos :)
<buzz0r> thanks again
<xevz> Would you want to access the foobar method in the "editor" class it would be "let editor_object = new editor in editor_object#foobar"...
<buzz0r> thanks xevz! thats a nice hint. so now can further go ahead step by step
<buzz0r> so this is me after 6 hours of playing with ocaml... feels good so far. But another thjing that i am curious about: Has anyone of you tried the ocaml java bindings? (since i would ike to use them in the future ~2-3 Weeks. with itext)
vixey has joined #ocaml
Kerris7 has quit []
<xevz> Do you want to call Java from O'Caml or O'Caml from Java?
<buzz0r> Java from ocaml
<Smerdyakov> It's "OCaml," not "O'Caml."
<xevz> Smerdyakov: Sorry.
cygnus has joined #ocaml
<vixey> I thought it was Ocaml
<Smerdyakov> Nope, that's wrong, too.
<xevz> Objective Caml... :)
<Smerdyakov> See the FAQ.
Kerris7 has joined #ocaml
<buzz0r> what do I need an initilizer for? ..
<thelema> to call methods of an object at creation time.
<buzz0r> thx!
Stefan_vK has quit [Read error: 110 (Connection timed out)]
Kerris7_ has joined #ocaml
Kerris7 has quit [Read error: 54 (Connection reset by peer)]
willb has quit ["Leaving"]
<buzz0r> Do you know: when do i need to write "let _ = main ()"
munga` is now known as munga
<Smerdyakov> buzz0r, I don't understand the question.
<buzz0r> ok, please see this blog: http://www.deskchecked.com/category/languages/ocaml/
<buzz0r> about hello world form gtk with different languages
<buzz0r> there is also an ocaml sample
<buzz0r> but i dont understand the last line
<buzz0r> "let _ = main ()
<gildor> buzz0r: calling main of GTK
<gildor> oops, nop
<gildor> totally useless line in fact
<gildor> i.e. "let _ = main ()" is useless
<gildor> it should not defined a main function
<gildor> (just as the definition of a destroy function which is totally useless)
<gildor> (and also the delete_event function)
s4tan has joined #ocaml
<flux> hm?
<flux> it's not useless
<flux> main won't get called if that line won't be there
<flux> defining a function called 'main' and then later just calling it is a common (?) way to write ocaml programs..
<buzz0r> so what dies this "_" stand for?
<buzz0r> does..
<Smerdyakov> buzz0r, what source are you using to learn OCaml?
TaXules has quit [Remote closed the connection]
TaXules has joined #ocaml
<gildor> flux: replace "let main () =" by "let _ = " and remove the call "let _ = main ()" is enough
<gildor> i never write "let main () = print_endline "coucou";; let _ = main ();;"
<gildor> i write "let () = print_endline "coucou";;"
<flux> perhaps not, but if the main is nontrivial, I do
<flux> and so does apparently the fellow writing the introduction ;)
<gildor> he also define destroy and delete event function which can typically be replaced by local function
<gildor> defines
<buzz0r> I have no dedicated documentation used so far, just googeling @ smerdyakov
<gildor> window#event#connect#delete ~callback:(fun _ -> false)
<Smerdyakov> buzz0r, OK. Personally, I never help people who aren't following more systematic approaches.
<Smerdyakov> buzz0r, I recommend reading this: http://files.metaprl.org/doc/ocaml-book.pdf
Stefan_vK has joined #ocaml
<buzz0r> ok, thanks Smerdy!
anryx has joined #ocaml
anryx has quit ["Leaving"]
ikaros has joined #ocaml
buzz0r has quit ["Ex-Chat"]
vpalle_ has joined #ocaml
willb has joined #ocaml
buzz0r has joined #ocaml
vpalle_ has quit [Read error: 104 (Connection reset by peer)]
olgen has quit []
vpalle has quit [Read error: 110 (Connection timed out)]
gdmfsob has quit [Read error: 104 (Connection reset by peer)]
<s4tan> how can I use 'Format.fprintf ff "%s" x'? what is ff?
<s4tan> I haven't found any reference to it in the ora-book :\
<hcarty> s4tan: The library reference should tell you
<s4tan> k
<s4tan> tnx hcarty
<hcarty> Glad to help. The library reference is a good thing to keep close by.
gdmfsob has joined #ocaml
<s4tan> yup : )
johnnowak has joined #ocaml
jackie has joined #ocaml
s4tan has quit []
johnnowak has quit []
buzz0r has quit [Remote closed the connection]
Anarchos has joined #ocaml
<Anarchos> i encounter so much trouble understanding the caml_local_roots variable :/
slash_ has joined #ocaml
<hcarty> Anarchos: You would probably have better luck on the mailing list
<Anarchos> hcarty ok. i try to interface with a C++ multithreaded api, protecting the callbacks with a semaphore, but i have random segault in caml_oldify_local_roots
jackie has quit [Remote closed the connection]
<Anarchos> hcarty i still think a concurrent GC would not improve the speed, but should improve the ability to link with multithread C++ api :)
slash_ has quit [Client Quit]
Anarchos has quit ["Vision[0.8.5-0418]: i've been blurred!"]
Kerris7_ has quit [Read error: 54 (Connection reset by peer)]
Kerris7 has joined #ocaml
_zack has quit ["Leaving."]
<palomer> speaking of C++
<palomer> how's ocaml qt coming along?
vpalle has joined #ocaml
<hcarty> palomer: The official archive does not seem to have been updated since the OSP ended. But there is something there.
vpalle_ has joined #ocaml
vpalle has quit [Read error: 60 (Operation timed out)]
ikaros_ has joined #ocaml
ikaros has quit [Read error: 60 (Operation timed out)]
Snark has quit ["Ex-Chat"]
vixey has quit [Remote closed the connection]
OChameau has quit [Read error: 113 (No route to host)]
Kerris7 has quit []
fschwidom has quit [Remote closed the connection]
mpeter has quit [Operation timed out]
alexyk has joined #ocaml
ikaros_ is now known as ikaros
ygrek has joined #ocaml
Associat0r has quit []
fschwidom has joined #ocaml
alexyk has quit []
ikaros has quit [".quit"]
buzz0r has joined #ocaml
buzz0r has quit [Client Quit]
buzz0r_ has joined #ocaml
buzz0r_ has quit [Client Quit]
ikaros has joined #ocaml
gdmfsob has quit [Read error: 110 (Connection timed out)]
Yoric[DT] has joined #ocaml
ygrek has quit [Remote closed the connection]
Mr_Awesome_ has quit ["aunt jemima is the devil!"]
vpalle_ has quit [Read error: 104 (Connection reset by peer)]
vpalle_ has joined #ocaml
hkBst has joined #ocaml
alexyk has joined #ocaml
marmotine has quit ["mv marmotine Laurie"]
_zack1 has joined #ocaml
alexyk has quit []
alexyk has joined #ocaml
ikaros has quit [".quit"]
alexyk has quit []
alexyk has joined #ocaml
_zack1 has quit ["Leaving."]
willb has quit ["Leaving"]
acatout has quit [Read error: 60 (Operation timed out)]
acatout has joined #ocaml
slash_ has joined #ocaml
vixey has joined #ocaml
hkBst has quit [Read error: 104 (Connection reset by peer)]
<palomer> ho hum
<palomer> looks like I'll be diving into caml4p soon
<Yoric[DT]> \o/
jeddhaberstro has joined #ocaml
vpalle__ has joined #ocaml
vpalle_ has quit [Read error: 60 (Operation timed out)]
alexyk has quit []
alexyk has joined #ocaml
seafood has joined #ocaml
vixey has quit ["There exists an infinite set!"]