flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab OCaml 3.10.2 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
seafood has joined #ocaml
hkBst has quit ["Konversation terminated!"]
marmotine has joined #ocaml
tomh has quit ["http://www.mibbit.com ajax IRC Client"]
sponge45 has left #ocaml []
sponge45 has joined #ocaml
sponge45 has left #ocaml []
Morphous has joined #ocaml
love-pingoo has quit [Read error: 110 (Connection timed out)]
Morphous_ has quit [Read error: 104 (Connection reset by peer)]
Ched- has joined #ocaml
<fbvortex> I'm doing some file I/O by calling I/O functions within a begin...end block. At some point within the begin...end block, I need to conditionally call either 1 or 2 I/O functions, both of which return Unit. An example of the conditional part: if (cond) then iofunc1 arg1 else begin iofunc2 arg2; iofunc3 arg3 end . However, the compiler complains that the else clause that starts with "begin" is not a function and cannot be applied. What is the co
<fbvortex> If I make the else clause just call a single I/O function without a begin...end, then the compiler doesn't complain. However, I need to make two different calls. I don't care about the return value of any of them...
<pango> you must have an error somewhere, there's no fundamental reason for this to fail, I/O functions or else
jlouis has quit [Remote closed the connection]
<pango> double check what part of your code is underlined when the error is displayed
<fbvortex> weird, I needed a semicolon after the end on the else clause
Ched has quit [Read error: 110 (Connection timed out)]
<pango> that seem consistent with the error message
pango has quit [Remote closed the connection]
pango has joined #ocaml
marmotine has quit ["Quitte"]
pango has quit [Remote closed the connection]
pango has joined #ocaml
Associat0r has quit []
johnnowak has joined #ocaml
RobertFischer has joined #ocaml
RobertFischer has quit ["Taking off -- check out http://smokejumperit.com and http://enfranchisedmind.com/blog/"]
Deffie_ has joined #ocaml
johnnowak has quit []
johnnowak has joined #ocaml
Deffie_ has quit []
Mr_Awesome has joined #ocaml
jwhiteman has joined #ocaml
seafood has quit [Read error: 110 (Connection timed out)]
jwhiteman has left #ocaml []
seafood has joined #ocaml
Tetsuo has joined #ocaml
Deffie_ has joined #ocaml
filp has joined #ocaml
seafood has quit [Read error: 110 (Connection timed out)]
johnnowak has quit []
seafood has joined #ocaml
rwmjones has joined #ocaml
petchema has quit [Read error: 104 (Connection reset by peer)]
hkBst has joined #ocaml
asmanur has joined #ocaml
seafood has quit []
Linktim has joined #ocaml
letrec has joined #ocaml
Linktim_ has joined #ocaml
Linktim has quit [Read error: 110 (Connection timed out)]
pattern has quit [Remote closed the connection]
letrec has quit [Read error: 110 (Connection timed out)]
baho_is has joined #ocaml
Linktim has joined #ocaml
m3ga has joined #ocaml
rwmjones_ has joined #ocaml
rwmjones has quit [Read error: 110 (Connection timed out)]
Linktim_ has quit [Read error: 110 (Connection timed out)]
letrec has joined #ocaml
Deffie_ has quit []
Yoric[DT] has joined #ocaml
<letrec> What would be the closest equivellent to map<pair<T1,T2>,T3> in ocaml library? Or should I implement my own module?
<flux> module M = Map.Make(struct type t = t1 * t2 let compare = compare end)
<flux> t3 is inferred
<flux> because it doesn't affect the way map works (that is: the ordering)
<Yoric[DT]> Or, with ExtLib, (('t1 * 't2), 't3) PMap
<Yoric[DT]> Or, with ExtLib, (('t1 * 't2), 't3) PMap.t, that is.
<letrec> How does compare work for turple?
<Yoric[DT]> non-specified
<Yoric[DT]> (technically, first element then second element)
Linktim_ has joined #ocaml
Linktim has quit [Read error: 110 (Connection timed out)]
Ched- has quit [Read error: 104 (Connection reset by peer)]
Ched- has joined #ocaml
Linktim has joined #ocaml
Linktim_ has quit [Read error: 110 (Connection timed out)]
Ched has joined #ocaml
sponge45 has joined #ocaml
sponge45 has left #ocaml []
sponge45 has joined #ocaml
asmanur has quit [Read error: 110 (Connection timed out)]
Linktim_ has joined #ocaml
Ched- has quit [Connection timed out]
jonas_e has joined #ocaml
olegfink has joined #ocaml
Linktim has quit [Read error: 110 (Connection timed out)]
Deffie_ has joined #ocaml
olegfink has quit [Nick collision from services.]
olegfink has joined #ocaml
bluestorm has joined #ocaml
<bluestorm> Yoric[DT]: congratulations :p
Linktim_ has quit [Read error: 110 (Connection timed out)]
<Yoric[DT]> ?
<Yoric[DT]> Oh.
<Yoric[DT]> Thanks :)
asmanur has joined #ocaml
olgagirl has joined #ocaml
olgagirl has quit [Client Quit]
baho_is has quit ["( www.nnscript.com :: NoNameScript 4.2 :: www.regroup-esports.com )"]
m3ga has quit ["disappearing into the sunset"]
tomh- has joined #ocaml
tomh- is now known as tomh
marmotine has joined #ocaml
munga has quit [Read error: 104 (Connection reset by peer)]
jlouis has joined #ocaml
Associat0r has joined #ocaml
LordMetroid has joined #ocaml
<rwmjones_> gildor, you sent me a patch for bitmatch (iirc) which I've completely lost
<rwmjones_> gildor, or in fact it was a patch for something else
* rwmjones_ looks again
<rwmjones_> ah right, it was for ocaml-libvirt, found it
<jynxzero> (Oops, accidental paste, sorry!!)
asmanur` has joined #ocaml
asmanur has quit [Read error: 110 (Connection timed out)]
<letrec> flux: Yoric[DT], regarding the map<> stuff, the Map.iter will depend on the way compare works for turple. So iter itself is undefined when using turple, right?
<flux> letrec, you can define a comparison function yourself
<flux> letrec, the let compare = compare was a lazy way to do that
<bluestorm> btw letrec you probably should not rely on the iteration order, as it is more or less implementation-dependent
<bluestorm> (it's specified in the documentation so is not meant to change, but having an unspecified evaluation order would not make Map.iter "undefined")
<jynxzero> Sorry to butt in, that seems a bit odd, if we can't rely on things specified in the documentation, how do we know what we can rely on??
<jynxzero> It seems that that is going to result in a lot of re-implementation of things like iter just so we can rely on the ordering, that is already specified in the documentation.
<letrec> flux: ok, makes sense, I can define my own compare indeed. But the iteration order should be defined, surely?? It does matter when writing algorithms.
seafood has joined #ocaml
pango has quit [Remote closed the connection]
<flux> letrec, it is my understanding iter will walk the tree from min to max elt, I don't remeber what the docs say
Linktim has joined #ocaml
pango has joined #ocaml
bzzbzz has joined #ocaml
Axioplase_ is now known as Axioplase
<mfp> the iteration order _is_ specified "The bindings are passed to f in increasing order with respect to the ordering over the type of the keys."; the precise semantics of compare relative to tuples and others isn't
<letrec> Also, I'm writing stuff like let (a,b) = Scanf.scanf "%s %s\n" (fun x y -> (x,y)) in... Is there a better way of doing that?
jonas_e has quit [Remote closed the connection]
<bluestorm> letrec: probably isn't
ChristopheT has joined #ocaml
Maslowski has joined #ocaml
rwmjones_ has quit ["Closed connection"]
pattern has joined #ocaml
filp has quit ["Bye"]
ChristopheT has left #ocaml []
tomh has quit ["http://www.mibbit.com ajax IRC Client"]
johnnowak has joined #ocaml
Linktim_ has joined #ocaml
seafood has quit []
<letrec> I've got module M = Map.Make (...) I need to define a reference to it... let m = ref M.empty doesn't work. How can I do? Thanks
Linktim has quit [Read error: 110 (Connection timed out)]
Linktim has joined #ocaml
<Smerdyakov> letrec, your questions tend to be too vague.
<Smerdyakov> letrec, please link to an example program and the error message you get or other reason that you think it "doesn't work."
<letrec> Please don't be offensive. If you don't understand my questions, just don't answer. Usually, I'm being understood by ocaml guys on this list.
<Smerdyakov> I'm not being offensive. I'm trying to help you.
asmanur` has quit [Read error: 110 (Connection timed out)]
coucou747 has joined #ocaml
<Smerdyakov> ...and you might want to consider that, even if people here manage to figure out what your questions mean, you are being rude to them by being unclear and forcing them to analyze your question.
<Smerdyakov> "Doesn't work" is a phrase that should never appear in questions about programming.
<Smerdyakov> You should state your expectation and explain what happens instead.
<bluestorm> letrec: in a nutshell, he's asking for your code
<Smerdyakov> Every line I've written is conveying new information. The message can't be condensed into "asking for his code."
<Smerdyakov> Concrete code examples are a useful part of the right way to ask programming questions, but stating expectations explicitly is another key part.
<flux> letrec, you can just use cps: don't construct the tuple, but put the code right in the function part of scanf
<bluestorm> heh, i had never thought of Scanf as a continuation passing function
Linktim_ has quit [Read error: 110 (Connection timed out)]
Linktim_ has joined #ocaml
pattern has quit [Remote closed the connection]
asmanur has joined #ocaml
love-pingoo has joined #ocaml
Linktim has quit [Read error: 110 (Connection timed out)]
Maslowski has left #ocaml []
palomer has joined #ocaml
gaja has quit [Read error: 110 (Connection timed out)]
l_a_m has quit [Remote closed the connection]
<flux> I took the perspective after writing a similar function :)
<palomer> oh wait, it's the other way around
<palomer> (or is it?)
<bluestorm> maybe there should be a [> or [< somewhere ?
<palomer> I'm doing an explicit coercion
olegfink has left #ocaml []
<fbvortex> is it possible to compile two modules which depend on each other?
<pango> no
<flux> if they are in different files, then no
<palomer> fbvortex, not if they're in two different files
<palomer> it's a huge bummer
<palomer> (I spend hours finding ways to get around this)
<flux> however, there are ways around this. you can have a module type signature and make the other module take it as a parmaeter
<palomer> but then the type signatures can't be mutually recursive, right?
<palomer> and the modules can't be toplevel
<fbvortex> yes, the way it's arranged now, each module is in one file. I can probably re-arrange the code though. thanks guys.
<flux> I personally haven't found that to be a too big of an issue. I've used classes for things that could be modules, though, and recursive class types are simple
<palomer> flux, they still need to be in 1 file
<palomer> I don't like having 1000 line files
<bluestorm> use camlp4 and #INCLUDE
<palomer> won't that screw up my error messages?
<bluestorm> i actually haven't tried, but there is quite a possibility it doesn't
mtrimpe has joined #ocaml
Deffie_ has quit []
love-pingoo has quit [Read error: 145 (Connection timed out)]
love-pingoo has joined #ocaml
bluestorm has quit ["Konversation terminated!"]
asmanur` has joined #ocaml
mtrimpe has quit [Read error: 104 (Connection reset by peer)]
mtrimpe has joined #ocaml
mtrimpe has quit [Connection reset by peer]
mtrimpe has joined #ocaml
Axioplase is now known as Axioplase_
asmanur has quit [Read error: 110 (Connection timed out)]
Tetsuo has quit [Read error: 54 (Connection reset by peer)]
Tetsuo has joined #ocaml
Tetsuo has quit [Read error: 104 (Connection reset by peer)]
asmanur` has quit [Read error: 110 (Connection timed out)]
marmotine has quit ["Quitte"]
Linktim_ has quit ["Quitte"]
Deffie_ has joined #ocaml
sfider has joined #ocaml
Deffie_ has quit [Client Quit]
pattern_ has joined #ocaml
pattern_ is now known as pattern
love-pingoo has quit ["Connection reset by pear"]
aryx has joined #ocaml
aryx has left #ocaml []
Yoric[DT] has quit ["Ex-Chat"]
hkBst has quit ["Konversation terminated!"]
sfider has quit [Remote closed the connection]
sponge45 has quit ["see you at http://ocamlhackers.ning.com/"]
LordMetroid has quit ["Leaving"]