flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.01.0 http://bit.ly/1851A3R | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
gnuvince has joined #ocaml
gnuvince has quit [Changing host]
gnuvince has joined #ocaml
Drup has quit [Quit: Leaving.]
csakatoku has joined #ocaml
csakatoku has quit [Remote host closed the connection]
ontologiae_ has quit [Ping timeout: 240 seconds]
chrisdotcode has quit [Remote host closed the connection]
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
mrpantoufle has quit [Ping timeout: 264 seconds]
mrpantoufle has joined #ocaml
chrisdotcode has joined #ocaml
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
gildor has quit [Quit: leaving]
demonimin has quit [Read error: Connection reset by peer]
hellome has quit [Remote host closed the connection]
zRecursive has joined #ocaml
nikki93 has quit [Remote host closed the connection]
csakatoku has joined #ocaml
q66 has quit [Quit: Leaving]
nikki93 has joined #ocaml
demonimin has joined #ocaml
andy753421 has joined #ocaml
shinnya has quit [Ping timeout: 252 seconds]
madroach has quit [Ping timeout: 264 seconds]
talzeus has joined #ocaml
madroach has joined #ocaml
ollehar has quit [Ping timeout: 240 seconds]
nikki93 has quit [Remote host closed the connection]
breakds has quit [Quit: Konversation terminated!]
octet8 has quit []
nikki93 has joined #ocaml
rgrinberg has joined #ocaml
caseyjames has quit [Ping timeout: 250 seconds]
f[x] has joined #ocaml
asmanur has quit [Ping timeout: 252 seconds]
darkf has quit [Ping timeout: 245 seconds]
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
octet8 has joined #ocaml
dezzy_ has joined #ocaml
dezzy has quit [Read error: Connection reset by peer]
nikki93 has quit [Remote host closed the connection]
caseyjames has joined #ocaml
<caseyjames> Hi, what is the best way to append a new element to the start of a list while removing the end to keep it a constant size?
<julm> i would say, to use Queue or something alike
asmanur has joined #ocaml
<caseyjames> cool thanks, I'll look into that
nikki93 has joined #ocaml
darkf has joined #ocaml
<caseyjames> Are queues pattern matched in the same way as lists?
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
Guest3279 has quit [Remote host closed the connection]
nikki93 has quit [Remote host closed the connection]
mcclurmc has quit [Quit: Leaving.]
chrisdotcode_ has joined #ocaml
nikki93 has joined #ocaml
chrisdotcode has quit [Ping timeout: 240 seconds]
nikki93 has quit [Remote host closed the connection]
chrisdotcode_ has quit [Remote host closed the connection]
chrisdotcode has joined #ocaml
<f[x]> Queue.t is an abstract type => black box => no pattern matching
yacks has quit [Quit: Leaving]
nikki93 has joined #ocaml
octet8 has quit []
nikki93 has quit [Ping timeout: 240 seconds]
zzz_` has joined #ocaml
Neros_ has joined #ocaml
Xuerian_ has joined #ocaml
ivan\_ has joined #ocaml
ia0_ has joined #ocaml
Nahra_ has joined #ocaml
beginn3r has joined #ocaml
orbitz_ has joined #ocaml
chris2_ has joined #ocaml
bacam_ has joined #ocaml
rgrinberg1 has joined #ocaml
hto_ has joined #ocaml
yours_truly has joined #ocaml
rgrinberg has quit [*.net *.split]
nisstyre has quit [*.net *.split]
Neros has quit [*.net *.split]
zarul has quit [*.net *.split]
chris2 has quit [*.net *.split]
pippijn has quit [*.net *.split]
ivan\ has quit [*.net *.split]
Nahra has quit [*.net *.split]
orbitz has quit [*.net *.split]
zzz_ has quit [*.net *.split]
Xuerian has quit [*.net *.split]
hto has quit [*.net *.split]
bacam has quit [*.net *.split]
ia0 has quit [*.net *.split]
ivan\_ is now known as ivan\
pippijn has joined #ocaml
caseyjames has quit [Ping timeout: 250 seconds]
pippijn has quit [*.net *.split]
pippijn has joined #ocaml
ijp has joined #ocaml
<ijp> hey, I'm trying to compile some software that depends on a string_misc module
nikki93 has joined #ocaml
<ijp> is that supposed to come with ocaml and if so when was it added/removed?
nikki93 has quit [Remote host closed the connection]
yours_truly has quit [Ping timeout: 256 seconds]
testcocoon has quit [Quit: Coyote finally caught me]
testcocoon has joined #ocaml
nikki93 has joined #ocaml
nisstyre has joined #ocaml
f[x] has quit [Ping timeout: 260 seconds]
gour has joined #ocaml
pippijn has quit [Quit: Reconnecting]
pippijn has joined #ocaml
zpe has joined #ocaml
<companion_cube> ijp: I don't think so
<companion_cube> or maybe it's in the compiler library
zpe has quit [Remote host closed the connection]
ggole has joined #ocaml
zpe has joined #ocaml
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
<flux> curiously a very old debian came with ocaml that has string_misc.cmx
<flux> it's maybe an ocaml 2.x thing
<flux> it seems to come with just one function, so maybe you can copy&paste it from there
<flux> I think it's the same as String's val index_from : string -> int -> char -> int, but the second and third arguments are swapped
<flux> well, not quite. String's index_from raises Not_found when not found, that function returns -1
ttamttam has joined #ocaml
csakatok_ has joined #ocaml
<ijp> hmm, it's funny, I don't even see that function being used
csakatoku has quit [Ping timeout: 256 seconds]
beckerb has joined #ocaml
orbitz_ has quit [Quit: Reconnecting]
orbitz has joined #ocaml
nikki93 has quit [Remote host closed the connection]
<ijp> well, it seems I can drop that dependency, but I still have other build problems to figure out. thanks.
<flux> good luck :)
ttamttam has quit [Read error: Connection reset by peer]
yezariaely has joined #ocaml
zRecursive has left #ocaml []
ttamttam has joined #ocaml
<adrien> ijp: there are some tools to transform caml light code to ocaml and I think there are tools to transition between the ocaml version too
<adrien> I don't know they coverage but they're worth checking
<adrien> (and the manual explains quite well how to migrate)
f[x] has joined #ocaml
ttamttam has quit [Ping timeout: 245 seconds]
djcoin has joined #ocaml
ttamttam has joined #ocaml
Simn has joined #ocaml
ttamttam has quit [Ping timeout: 264 seconds]
zpe has quit [Remote host closed the connection]
chrisdotcode_ has joined #ocaml
chrisdotcode_ has quit [Remote host closed the connection]
chrisdotcode has quit [Ping timeout: 256 seconds]
yroeht2 is now known as yroeht
ontologiae_ has joined #ocaml
ttamttam has joined #ocaml
bacam_ is now known as bacam
thomasga has joined #ocaml
Neros_ has quit [Ping timeout: 240 seconds]
ttamttam has quit [Quit: ttamttam]
ttamttam has joined #ocaml
TDJACR has quit [Ping timeout: 245 seconds]
jave has joined #ocaml
adrien_o1w is now known as adrien_oww
mort___ has joined #ocaml
weie has quit [Read error: Connection reset by peer]
weie has joined #ocaml
zpe has joined #ocaml
q66 has joined #ocaml
weie_ has joined #ocaml
weie has quit [Ping timeout: 248 seconds]
mort___ has quit [*.net *.split]
Yoric has joined #ocaml
dezzy_ is now known as dezzy
mort___ has joined #ocaml
Kakadu has joined #ocaml
chris2_ is now known as chris2
q66 has quit [Quit: Leaving]
maufred has joined #ocaml
q66 has joined #ocaml
Neros has joined #ocaml
Kakadu has quit []
Kakadu_ has joined #ocaml
Neros has quit [Ping timeout: 245 seconds]
Neros has joined #ocaml
Neros has quit [Ping timeout: 245 seconds]
Kakadu_ has quit [Ping timeout: 240 seconds]
TDJACR has joined #ocaml
darkf has quit [Quit: Leaving]
Drup has joined #ocaml
octet8 has joined #ocaml
ollehar has joined #ocaml
<companion_cube> the're quite a lot of activity going on opam ^^
Drup has quit [Ping timeout: 252 seconds]
mchqwerty has joined #ocaml
ollehar has quit [Ping timeout: 245 seconds]
malo has joined #ocaml
ontologiae_ has quit [Ping timeout: 240 seconds]
Neros has joined #ocaml
gnuvince has quit [Ping timeout: 245 seconds]
breakds has joined #ocaml
Drup has joined #ocaml
ia0_ is now known as ia0
Kakadu has joined #ocaml
breakds has quit [Quit: Konversation terminated!]
talzeus has quit [Remote host closed the connection]
_andre has joined #ocaml
Neros has quit [Ping timeout: 245 seconds]
Neros has joined #ocaml
mort___ has quit [Ping timeout: 241 seconds]
shinnya has joined #ocaml
talzeus has joined #ocaml
<reynir> Anyone know if there's a DSL for implementing http/json APIs?
<reynir> Like, some services offer an API where you use http requests and get JSON back
<Drup> there is lot of libraries to implement an http server
<reynir> Sorry, I wasn't clear. I meant *clients* for such APIs
<Drup> oh, sure
<companion_cube> there is cohttp for http client
<companion_cube> I think
<Drup> indeed
<companion_cube> about json, there are parsers
<reynir> I'm using ocamlnet and atdgen
<Drup> let me find a good blog post about it
<reynir> Using atdgen for this works pretty well
<johnelse> I've been using cohttp+atdgen - also works nicely
Kakadu has quit [Ping timeout: 250 seconds]
zxqdms has joined #ocaml
<reynir> Often those APIs implement a poor man's variants by having a "type" field or similar
<reynir> like, '{ "type": "None" }' and '{ "type": "Some", "data": 42 }'
<reynir> It's messy :)
ontologiae_ has joined #ocaml
ijp has left #ocaml []
<Drup> reynir: that's the big problem with binding web stuff
<Drup> they keep trying to reinvent static typing, but they do it so badly that you have to redo all the work.
<reynir> Yea
<reynir> I'm implementing a client for a VPS's api. You can ask for info about a specific VM by giving the id. When you create a new VM you also get info about the newly created VM, but a lot of the fields are missing because "they are obvious / can be derivied from the arguments in the request"
<adrien_oww> (not rackspace btw?)
<reynir> It means I have to have 2 VM types, one for when creating a new VM and one for everything else
<reynir> digitalocean
<adrien_oww> ok
<reynir> I think rackspace owns digitalocean maybe?
csakatoku has joined #ocaml
<adrien_oww> not sure; all I know is that avsm is working on their api too
<adrien_oww> s/ too//
<reynir> Ah
<reynir> Some of their api is also poorly documented
<Drup> reynir: if you want to use ocsigen, I'm (very slowly) building a binding for a big API so I did a little "dsl" like library
<reynir> like, in the VM you have a field "backup" which is a list. The problem is in their sample response the list is empty lol
<Drup> reynir: you can probably do the same sort of thing with cohttp
<Drup> reynir: it's here under src/api/ https://github.com/drup/eveliom
csakatoku has quit [Remote host closed the connection]
<reynir> Oh, I have implemented most of the api by now. I was just curious because it seemed like a problem well suited for a DSL :)
<Drup> ok
<Drup> you can emulate a pseudo-dsl quite nicely with ocaml constructions
csakatok_ has quit [Ping timeout: 256 seconds]
<reynir> I have used camlp4 (or camlp5?) once. It's pretty nice
l_a_m has joined #ocaml
<l_a_m> hi
<l_a_m> i search a lightweb framework to build a RESTful webservice
<l_a_m> any idea ?
<Drup> reynir: I meen, whith *native* constructions
<reynir> Yea, I understood that :D
f[x] has quit [Ping timeout: 264 seconds]
talzeus has quit [Remote host closed the connection]
talzeus has joined #ocaml
<Drup> l_a_m: there is several http server implemented in ocaml from the lighter to the heavier, I would say : ocaml-http (small and limitated, not sure if maintained anymore), cohttp (is a library), ocsigen (is a full stack server and you can use eliom too), ocamlnet.
<Drup> (before some one said it, yes, the order at the end is dubious)
gnuvince has joined #ocaml
<companion_cube> cohttp also does server? neat
gnuvince has quit [Changing host]
gnuvince has joined #ocaml
<Drup> I think so
<Drup> if it's not cohttp, then it's something else somewhere in the mirage stack.
<companion_cube> that's cool.
<reynir> I think it's hard to decide which library to use - there are several that seem to do more or less the same :)
<pippijn> Very lightweight HTTP server using Lwt. Contribute to ocaml-cohttp development by creating an account on GitHub.
<companion_cube> I'd go with cohttp, since it uses Lwt, but well.
<Drup> cohttp is probably the best solution if you just want a lightweigth stuff and do most of the work by yourself
<Drup> eliom/ocsigen is more featureful but ... :p
<reynir> What library would you suggest if I only need to be able to make HTTP GET requests?
<reynir> ocamlnet seems like a huge library. I'd prefer a smaller library if ocamlnet isn't widespread :)
<companion_cube> is there a documentation flag in opam, to specify where the documentation should go?
<Drup> reynir: ocamlnet does not have, afaik, async ability. It's somewhat a huge issue
<Drup> (and yeah, it's big and complicated too)
<companion_cube> it doesn't?
<companion_cube> I thought it had some horribly complicated "engine" system
<adrien_oww> equeue ?
<pippijn> I like lwt very much
<pippijn> the only thing I don't like about lwt is that they don't quite behave like haskell I/O
<pippijn> I mean IO
<companion_cube> well, lazy IO are a mess
<companion_cube> I like Lwt very much too
<pippijn> I like lazy io
<companion_cube> pippijn: but maybe you can write iteratee for Lwt, I heard they are fashionable in the haskell community ;)
<pippijn> for example, I can say: let thr = print something;; let foo bar = ... lwt () = thr in ...
<pippijn> I'd like lwt threads to be started only when they become part of a running thread
<Drup> urk, that would be weird
<pippijn> why?
<Drup> well, not weird
<companion_cube> on the contrary, it's nice being able to say Lwt.ignore_result some_thread
<Drup> but debuging race conditions with lazy evaluation ... X_x
<pippijn> Lwt.async would start them
<companion_cube> to run in the background
<pippijn> companion_cube: that's what async is for
<companion_cube> but it starts a system thread, doesn't it?
<pippijn> no
<pippijn> that's Lwt_preemptive
<companion_cube> oh.
<pippijn> "async f starts a thread without waiting for the result. If it fails (now or later), the exception is given to Lwt.​async_exception_hook. "
<companion_cube> hmm, right, actually I should use async
<companion_cube> rather than ignore_result
<pippijn> Drup: I don't think there is a difference wrt race conditions
<pippijn> lazy threads just mean: they start out sleeping, rather than running
<pippijn> and you explicitly need to start them
<pippijn> so you can make a collection of threads and then start all of them with Lwt.join or choose
<Drup> I prefer the current way
<companion_cube> me too
<companion_cube> you can have threads waiting before they start, using Lwt.wait()
<pippijn> companion_cube: are you sure?
<companion_cube> it requires some code
<pippijn> yeah
<pippijn> that's just a lock
<pippijn> ugly
<pippijn> Lwt.wait should be used when you depend on that order
<pippijn> usually I don't depend on it, but reasoning about it is easier
<pippijn> like in haskell, you can just say: a = putStrLn "hello"
<pippijn> and it will not be executed before it's put into the main execution chain
<companion_cube> lazy evaluation and side effects are too complicated for me
<pippijn> side effects occuring at random points in time are more complicated
<companion_cube> well, if I start a lwt thread, I know the side effect will occur
<companion_cube> regardless of evaluation of anything
<pippijn> for me, that knowledge is not useful at all
<pippijn> I want to know that a side effect will occur before something else happens
<companion_cube> pippijn: I think you can write your combinators on top of Lwt, like a "lazy" >>=
<companion_cube> or lazy return?
<pippijn> yeah
<companion_cube> or just wrap the thread in Lazy
<pippijn> and make it unmaintainable for anyone who expects the normal lwt semantics
<reynir> \o/
<pippijn> no, I'm fine with lwt the way it is
<l_a_m> Drup: i see ocsigne
<l_a_m> Drup: i search more light than ocsigen ...
<l_a_m> Drup: i will read about cohttp
<companion_cube> pippijn: when all those projects of multi-runtimes are released/production ready, I think a multicore lib using Lwt would be great
<companion_cube> or a multicore extension of Lwt, dually
saml has joined #ocaml
yezariaely has quit [Quit: Leaving.]
<Drup> companion_cube: that seems quite hard in general, since the "good" way to do multicore in ocaml is message passing with forking processus and that's not really close to lwt way of doing stuff
<companion_cube> Drup: soon, forking should not be necessary
<companion_cube> but Lwt would serve to wait for messages from other runtimes
<Drup> soon™ :D
<companion_cube> I didn't mean every Lwt thread should map to a process :)
<Drup> (i know about lucas's work, yes ;))
<Drup> companion_cube: in that case, yeah, that's clearly a good idea
Neros has quit [Ping timeout: 245 seconds]
csakatoku has joined #ocaml
csakatoku has quit [Ping timeout: 256 seconds]
octet8 has quit []
octet8 has joined #ocaml
q66_ has joined #ocaml
q66 has quit [Disconnected by services]
q66_ is now known as q66
mort___ has joined #ocaml
Neros has joined #ocaml
l_a_m has left #ocaml []
talzeus has quit [Remote host closed the connection]
f[x] has joined #ocaml
talzeus has joined #ocaml
talzeus has quit [Remote host closed the connection]
Snark has joined #ocaml
ollehar has joined #ocaml
talzeus has joined #ocaml
octet8 has quit []
cesar_ has joined #ocaml
cesar_ is now known as Guest90689
tobiasBora has joined #ocaml
tyty has joined #ocaml
madroach has quit [Quit: leaving]
<tyty> I identified an issue with OpsCode's official Chef Jenkins recipe. I'm using a nginx proxying setup that differs from what the recipe proposes, necessitating Jenkins being told what it's $PREFIX in a different manner. I haven't signed the contributers agreement. What does the community prefer, I submit a merge request to the recipe's GH repo, or create an issue in the JIRA "Chef Cookbooks" project, or ???
tyty has left #ocaml []
<reynir> wrong channel?
mchqwerty has quit [Remote host closed the connection]
<adrien_oww> :D
Guest90689 has quit [Read error: Connection reset by peer]
talzeus has quit [Remote host closed the connection]
iZsh has quit [Excess Flood]
iZsh has joined #ocaml
tane has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest39065
tobiasBora_ has joined #ocaml
tobiasBora has quit [Read error: No route to host]
paddymahoney has joined #ocaml
Guest39065 has quit [Remote host closed the connection]
Neros_ has joined #ocaml
mort___ has quit [Ping timeout: 240 seconds]
Neros has quit [Ping timeout: 245 seconds]
yezariaely has joined #ocaml
gnuvince has quit [Ping timeout: 260 seconds]
ontologiae_ has quit [Ping timeout: 264 seconds]
zpe has quit [Remote host closed the connection]
nikki93 has joined #ocaml
technomancy has left #ocaml []
yezariaely has quit [Read error: Operation timed out]
ttamttam has quit [Quit: ttamttam]
djcoin has quit [Quit: WeeChat 0.4.1]
yacks has joined #ocaml
nikki93 has quit [Remote host closed the connection]
f[x] has quit [Ping timeout: 240 seconds]
mcclurmc has joined #ocaml
nikki93 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
ulfdoz has joined #ocaml
demonimin has quit [Ping timeout: 260 seconds]
Neros_ is now known as Neros
Neros has quit [Ping timeout: 248 seconds]
demonimin has joined #ocaml
ontologiae_ has joined #ocaml
Drup has quit [Read error: Operation timed out]
ontologiae_ has quit [Ping timeout: 246 seconds]
Drup has joined #ocaml
nikki93 has joined #ocaml
ollehar has quit [Ping timeout: 240 seconds]
nikki93 has quit [Remote host closed the connection]
gereedy has quit [Ping timeout: 245 seconds]
gereedy has joined #ocaml
nikki93 has joined #ocaml
Neros has joined #ocaml
troydm has joined #ocaml
nikki93 has quit [Remote host closed the connection]
mcclurmc has quit [Quit: Leaving.]
mcclurmc1 has joined #ocaml
clog has quit [^C]
clog has joined #ocaml
<Kakadu> shorter example: http://paste.in.ua/8781/raw/
<mrvn> because #cc is polymorphic
<ggole> There's an implicit type variable in some types
<mrvn> #cc is any 'a that can be unified with the type of cc
<ggole> You get the same thing with polymorphic variants
<ggole> type foo = [>`Foo] type record = { x: foo }
<ggole> Either introduce an argument or make the type monomorphic.
<Kakadu> So, how can I express 'field ooo is object whose type is subtype of class cc'?
<ggole> Introduce an argument, I think
<mrvn> # type tt = { ooo: 'a. (#cc as 'a) };;
<mrvn> type tt = { ooo : 'a. #cc as 'a; }
* ggole doesn't use objects much
* Kakadu smells existantionals
<mrvn> or make it type cc and use :> on asignment
<Kakadu> mrvn: Can u help me to construct record? http://paste.in.ua/8782/raw/
nikki93 has joined #ocaml
shinnya has quit [Ping timeout: 248 seconds]
<mrvn> type tt = { ooo: cc; };;
<mrvn> # { ooo = (o1 :> cc); };;
<mrvn> - : tt = {ooo = <obj>}
<mrvn> class cc2 = object inherit cc method bar = 1 end;;
<mrvn> let o2 = new cc2;;
<mrvn> # { ooo = (o2 :> cc); };;
<mrvn> - : tt = {ooo = <obj>}
<mrvn> Seams like an existentail type doesn't work there
<Kakadu> Okay, thanks a lot
clog has quit [^C]
clog has joined #ocaml
manizzle has joined #ocaml
demonimin has quit [Remote host closed the connection]
demonimin has joined #ocaml
nikki93 has joined #ocaml
darkf has joined #ocaml
gour has quit [Disconnected by services]
gour_ has joined #ocaml
ollehar has quit [Ping timeout: 240 seconds]
skchrko has quit [Quit: Leaving]
<tobiasBora_> Hello,
<tobiasBora_> I try to create a connection with sockets between two processus. This is my server :
<tobiasBora_> and the client : http://paste.ubuntu.com/6176948
Drup has left #ocaml []
<tobiasBora_> However when I run the server, and after the client, the "listen" function doesn't stop, like if there is no connection...
Drup has joined #ocaml
beginn3r has quit [Quit: Leaving]
gour_ has quit [Quit: WeeChat 0.4.1]
beginn3r has joined #ocaml
beginn3r has quit [Read error: Connection reset by peer]
ulfdoz has joined #ocaml
beginn3r has joined #ocaml
beginn3r has quit [Remote host closed the connection]
zarul has joined #ocaml
<Anarchos> tobiasBora_ did you use accept as intended ?
<tobiasBora_> Anarchos: I think but I'm not sure. I wrote : let (answer_descr, answer_sockaddr) = Unix.accept s_descr in
<tobiasBora_> Oh...
Neros has quit [Ping timeout: 245 seconds]
<tobiasBora_> No I don't see... Here : http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora186.html they say that the function is like this : - : Unix.file_descr -> Unix.file_descr * Unix.sockaddr = <fun>, so it takes only one argument no ?
<Anarchos> yes
nikki93 has quit [Remote host closed the connection]
yezariaely has quit [Quit: Leaving.]
Simn has quit [Read error: Connection reset by peer]
Simn has joined #ocaml
Neros has joined #ocaml
Armael has quit [Ping timeout: 240 seconds]
_andre has quit [Quit: leaving]
nikki93 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
paddymahoney has quit [Remote host closed the connection]
<tobiasBora_> Anarchos: I don't see...
<Anarchos> tobiasBora_ i can't help you more, maybe try to look at network programming samples in ocaml ?
<Anarchos> tobiasBora_ google ocaml+accept+listen ?
<tobiasBora_> Ok Thank you.
<tobiasBora_> That's what I'm trying to do.
<adrien> tobiasBora_: networking in ocaml is very close to any unix networking: you can look at any C tutorial and use it for ocaml
<tobiasBora_> Ok ! I've found a great tutorial, I'll try to understand it !
<tizoc> tobiasBora_: do you know about this book? http://ocamlunix.forge.ocamlcore.org
<tobiasBora_> Oh I found the same but translated in french ^^ Thank you !
<tizoc> tobiasBora_: heh, the french one is probably the original
<companion_cube> it may be more idiomatic, nowadays, to use cooperative threading ;)
<tobiasBora_> ok
<tobiasBora_> companion_cube: in speech ?
<companion_cube> in ocaml
<smondet> tobiasBora_: you can also use Unix.establish_server, it's more "high-level" (and there is Unix.open_connection too)
<tobiasBora_> smondet: That's what I'm seeing... I'll try it ! But I'm happy, now it works !
<tobiasBora_> (I didn't use bind in the good place : it's for the server, and not for the client !)
thomasga has joined #ocaml
nisstyre has quit [Ping timeout: 248 seconds]
nikki93 has joined #ocaml
yacks has joined #ocaml
tane has quit [Remote host closed the connection]
tane has joined #ocaml
nisstyre has joined #ocaml
octet8 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
ulfdoz has quit [Ping timeout: 245 seconds]
tane has quit [Quit: Verlassend]
Kakadu has quit []
ollehar has joined #ocaml
sgnb has quit [Remote host closed the connection]
sgnb has joined #ocaml
Yoric has quit [Ping timeout: 245 seconds]
ontologiae_ has joined #ocaml
<tobiasBora_> With the try... with function, is it possible to add after some code or all code must be in with ... ?
<thomasga> let x = try … with … in … x ...
<thomasga> (try … with …); ...
Yoric has joined #ocaml
<manizzle> what the difference between let ... in and let is for definitions of things
<manizzle> why is the in required? is the code after the in some sort of code block for the let?
<manizzle> for local scoping?
<kerneis> manizzle: yes
<manizzle> im just confused on the in of the let and local scoping.
<manizzle> then how come i sometimes see just let
<thomasga> local let vs. global let
<kerneis> with let x = a in b, x is bound to a only in b
<manizzle> let x = a in b;; is only in b and let x = a;;
<manizzle> first is scoped x for b code block and x is scoped for whole module?
<kerneis> (let x = 1); (let x = 2 in print_int x); print_int x;
<kerneis> would print 2 then 1
<kerneis> it is equivalent to renaming the local x to something else, like y for example:
<kerneis> (let x = 1); (let y = 2 in print_int y); print_int x;
<manizzle> cool thanks
<thomasga> kerneis: your examples don't parse
Armael has joined #ocaml
<thomasga> :p
<kerneis> really?
<kerneis> oh well, it should be ;; instead of ; I guess
<thomasga> and whithout the parenthesis
<thomasga> but well, the idea is there
<kerneis> hu, why does the parenthesis fail to parse?
<kerneis> I thought you could add them everywhere
<kerneis> and just tried to make the scoping obvious in a one-liner
<kerneis> it fails indeed
<kerneis> time to go to bed
mcclurmc1 has quit [Ping timeout: 252 seconds]
<tobiasBora_> thomasga: thank you !
<companion_cube> thomasga: apparently the 4.00.1+alloc-profiling switch is a 404
mcclurmc has joined #ocaml
<thomasga> what's the url ?
mcclurmc has quit [Quit: Leaving.]
<companion_cube> no idea
<companion_cube> 'opam switch -v 4.00.1+alloc-profiling' failed.
<companion_cube> curl: 404 is not a valid return code
<tobiasBora_> Is it possible to send in an in_channel an EOF signal ?
<companion_cube> tobiasBora_: you need to close it
<companion_cube> oh, sorry
<companion_cube> an in_channel? tough
<tobiasBora_> Euh sorry in an out channel
<Anarchos> tobiasBora_ yes it is
<tobiasBora_> companion_cube: the problem is that when I close the channel, it close the socket connection...
<tobiasBora_> *closes
<tobiasBora_> I will explain my problem :
<tobiasBora_> I want to send a message to a server, and wait for the answer. But the server is in an infinite loop while it is not in the end of the input chan, so I need to send EOF to this chan (which is an output chan for the client) in order to leave the infinite loop and send back the message.
<tobiasBora_> But If I close the chan, the connection is closed...
Anarchos has quit [Quit: Vision[0.9.7-H-280704]: i've been blurred!]
ontologiae_ has quit [Ping timeout: 248 seconds]
Yoric has quit [Ping timeout: 240 seconds]
tobiasBora_ has quit [Quit: Konversation terminated!]
tristero has joined #ocaml
thomasga has quit [Quit: Leaving.]
<smondet> tobiasBora_: EOF is kind-of the way the operating systems tell you a channel is being closed
<smondet> you should not be able to have one without the other
<smondet> if your server needs to reply it has to detect the end of the message
ng_ has joined #ocaml
emmanuelux has joined #ocaml
<ng_> how i use big_int in ocaml??? i compile, but appears an error "Unbound value string_of_big_int"
<smondet> the cannonical way is to send the length of the message before the message
<ng_> and i put the "load in my code"
<ng_> and i compile with nums.cmxa
demonimin has quit [Remote host closed the connection]
ollehar has quit [Ping timeout: 248 seconds]
kay_ has quit [Remote host closed the connection]
<smondet> ng_: what is the "load in my code"? are you using ocamlfind?
_tca has joined #ocaml
talzeus has joined #ocaml
<ng_> smondet, I use #load "nums.cma" ;;
<ng_> problem solved
<ng_> ty ;)
demonimin has joined #ocaml
gnuvince has joined #ocaml
gnuvince has quit [Changing host]
gnuvince has joined #ocaml
ng_ has quit [Quit: Leaving]
Xuerian_ is now known as Xuerian