smimou changed the topic of #ocaml to: OCaml 3.08.3 available! | Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
cmeme has joined #ocaml
cmeme has quit [Remote closed the connection]
cmeme has joined #ocaml
mikeX has joined #ocaml
monochrom has joined #ocaml
threeve has quit []
mikeX has quit ["Leaving"]
vezenchio has quit ["\o/ in mochintin namocniuh \o/"]
Saulzar has joined #ocaml
ramkrsna has joined #ocaml
Smerdyakov has joined #ocaml
monochrom has quit ["good morning, sweet dream"]
batdog has joined #ocaml
joeytwiddle has joined #ocaml
batdog is now known as batdog|gone
UziMonkey has joined #ocaml
ramkrsna has left #ocaml []
Saulzar_ has joined #ocaml
Saulzar has quit [Read error: 110 (Connection timed out)]
threeve has joined #ocaml
Smerdyakov has quit []
ski has joined #ocaml
Snark has joined #ocaml
threeve has quit []
oliver__ has joined #ocaml
Saulzar_ has quit [Read error: 60 (Operation timed out)]
Skal has joined #ocaml
oliver__ has quit [Read error: 60 (Operation timed out)]
Saulzar has joined #ocaml
Boojum has joined #ocaml
Snark has quit [Nick collision from services.]
Boojum is now known as Snark
Gueben has joined #ocaml
Boojum has joined #ocaml
Snark has quit [Read error: 110 (Connection timed out)]
Skal has quit ["Client exiting"]
Skal has joined #ocaml
Tipsy2 has joined #ocaml
vezenchio has joined #ocaml
batdog|gone is now known as batdog
Smerdyakov has joined #ocaml
threeve has joined #ocaml
threeve has quit [Client Quit]
er has joined #ocaml
<er> match (x) with | x1->stmt1; | x2->stmt2; stmt3;
<er> does stmt3 associate with the match with x2, or all matches?
<er> how does one force it to associate with the parent?
<Saulzar> I believe it is the same thing as match (x) with | x1->stmt1; | x2-> (stmt2; stmt3;)
<Saulzar> But using x; is also equivalent to let () = x in .. I think, if that helps
<er> Saulzar: that's what the output of my program suggests too.
<er> Saulzar: but I'm trying to make it associate with all the matches, so...
<Smerdyakov> Saulzar, not quite equivalent at the level of concrete syntax. Different associativity.
<Smerdyakov> er, use parentheses or 'begin..end'.
<er> (match x with | x1->stmt1;|x2->stmt2) stmt3;
<Smerdyakov> Almost. That's a function application.
<Saulzar> Ah ok - I'm still not 100% on it myself ..
<er> Smerdyakov: um, exactly. that's what ocamlc says as well, so I'm glad you agree...
<er> :)
<er> what is the correct way?
<Saulzar> Semi-colon the brackets
<Smerdyakov> er, add a semicolon after the close-paren.
<Smerdyakov> er, there is no magic or complicated rule to learn here. OCaml has only one class of program elements at this level: expressions.
<Smerdyakov> er, calling something a "statement" will get you smacked. ;)
<Saulzar> Yeah, it just seems there's something wierd going on when you first see there is also syntax for imperitive stuff
<Smerdyakov> er, so you operate on 'match' expressions with operators just like you would with integer constants.
<Saulzar> Hmm, I think I prefer begin/end to brackets... makes it clear you're using imperitive style
<Smerdyakov> Saulzar, of course, there is no objective reason to say it makes that clear, since they're just syntactic "anti-abbreviations" for parens.
<Saulzar> Yeah, I know..
<er> i called them statements because they cause side effects
<Smerdyakov> er, I don't think that is standard usage.
<er> ok
Boojum is now known as Snark
Tipsy2 has quit []
Snark has quit [Read error: 60 (Operation timed out)]
Snark has joined #ocaml
__DL__ has joined #ocaml
er has quit ["Leaving"]
moea has joined #ocaml
<moea> is there a convenient way to convert floats into their internal ieee 754 representation?
<moea> something like python's struct.pack('!d', float)
moea has quit ["weeeeeee"]
pango has joined #ocaml
ski has quit [Read error: 110 (Connection timed out)]
mikeX has joined #ocaml
mauke is now known as mauke_
mfurr_vac is now known as mfurr
mauke_ is now known as mauke
<mikeX> what's the deal with GWindow.message_dialog in lablgtk2? I can't understand that [> DELETE_EVENT] as a') buttons at all :/
__DL__ has quit ["Bye Bye"]
pnou has joined #ocaml
pnou_ has joined #ocaml
pnou has quit [Read error: 104 (Connection reset by peer)]
<mikeX> ok let me put it this way, what could "([> `VARIANT1 ] as 'a) `VARIANT2" possibly mean?
<mauke> 'a looks like a type variable
<mikeX> hmmm :/
<mauke> "Polymorphic variants"
<mikeX> yeah I am, not that I can make that much of it :(
<mikeX> >looking at it<
<mikeX> can you think of something that matches this type?
<mauke> is that the whole type?
<mikeX> well the actual type is "([> `DELETE_EVENT ] as 'a) buttons", with "type buttons = [ `CANCEL | `CLOSE | `NONE | `OK | `OK_CANCEL | `YES_NO ]"
<mauke> huh? why "as 'a" then?
<mikeX> :?
<mauke> if 'a isn't used anywhere else, why is it declared there?
<mikeX> don't ask me :/
<mikeX> *sigh*
<mauke> is this code online somewhere?
<mikeX> yeah sure, hold on
<mikeX> here's the "buttons" declaration
<mikeX> hmm, I can't seem to find the other one online
<mikeX> look at 'GtkMessageDialog'
<mauke> that's not the same "buttons"
<mikeX> oops
<mikeX> :/
<mauke> it seems to declare a parameter labeled "buttons" of type ([> `DELETE_EVENT ] as 'a) buttons
<mauke> 'a is declared there because it's used in the return type
<mikeX> so, what is the type of the parameter (an example)?
<mauke> hmm, "buttons" seems to be an abstract type
petter_ has quit [Read error: 110 (Connection timed out)]
<mauke> let's make a dummy definition: type 'a buttons = Whatever of 'a;;
<Smerdyakov> Polymorphic variants are an atrocity.
<mauke> then Whatever `DELETE_EVENT;; results in - : [> `DELETE_EVENT] buttons = Whatever `DELETE_EVENT
<mauke> I've never used them
<mikeX> :/
<mikeX> i see (i think)
<mikeX> thanks for the help
mikeX has quit ["Leaving"]
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
pnou_ has quit ["brb"]
pnou has joined #ocaml
pnou has quit [Client Quit]
pnou has joined #ocaml
<Amorphous> Saulzar: some days ago you wrote "I've noticed something about using mutable values... eg. as soon as I use a Hashtbl in a data structure then everything from there on down is 'infected' with being mutable" i'm interested in an example for that, if that wouldn't bother you, could point me to one, please?
ulfdoz_ has joined #ocaml
threeve has joined #ocaml
mlh_ has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
Smerdyakov has quit ["I smell horrible."]