kaustuv changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.1 out now! Get yours from http://caml.inria.fr/ocaml/release.html
bscofield has quit [Connection timed out]
onigiri has quit [Client Quit]
bscofield has joined #ocaml
svenl has quit [Read error: 104 (Connection reset by peer)]
lutter has quit ["Leaving."]
Mr_Awesome has joined #ocaml
Demitar has quit [Read error: 110 (Connection timed out)]
Demitar has joined #ocaml
thrasibule has quit [Read error: 60 (Operation timed out)]
thrasibule has joined #ocaml
Cromulent has joined #ocaml
tmaedaZ is now known as tmaeda
Modius has joined #ocaml
Cromulent has quit []
Cromulent has joined #ocaml
Makoryu has joined #ocaml
bluestorm has joined #ocaml
thrasibule has quit ["No Ping reply in 90 seconds."]
thrasibule has joined #ocaml
thrasibule_ has joined #ocaml
thrasibule has quit [Read error: 104 (Connection reset by peer)]
thrasibule_ has quit [Read error: 110 (Connection timed out)]
Cromulent has quit []
jeddhaberstro has quit [Client Quit]
Cromulent has joined #ocaml
Beelsebob has joined #ocaml
Cromulent has quit []
f[x] has joined #ocaml
onigiri has joined #ocaml
Cromulent has joined #ocaml
onigiri has quit [Client Quit]
bluestorm has quit [Remote closed the connection]
LeCamarade|Away is now known as LeCamarade
Cromulent has quit []
rwmjones-afk is now known as rwmjones
f[x] has quit [Read error: 110 (Connection timed out)]
f[x] has joined #ocaml
hkBst has joined #ocaml
tmaeda is now known as tmaedaZ
acatout has quit [Read error: 110 (Connection timed out)]
julm_ has joined #ocaml
julm has quit [Read error: 110 (Connection timed out)]
chrisbrown has joined #ocaml
Yoric[DT] has joined #ocaml
pveber has joined #ocaml
Cromulent has joined #ocaml
Beelsebob has quit ["Leaving."]
Beelsebob has joined #ocaml
hkBst has quit [Read error: 104 (Connection reset by peer)]
Beelsebob has quit [SendQ exceeded]
hkBst has joined #ocaml
hkBst has quit [Read error: 104 (Connection reset by peer)]
Beelsebob has joined #ocaml
hkBst has joined #ocaml
Camarade_Tux has quit [Remote closed the connection]
Asmadeus has quit [Remote closed the connection]
adrien has joined #ocaml
rwmjones is now known as rwmjones-lunch
adrien is now known as Camarade_Tux
_andre has joined #ocaml
Cromulent has quit []
aldebrn has joined #ocaml
_zack has joined #ocaml
yurug has joined #ocaml
Beelsebob has quit [SendQ exceeded]
Beelsebob has joined #ocaml
Beelsebob has quit [SendQ exceeded]
Beelsebob has joined #ocaml
Yoric[DT] has quit [Read error: 110 (Connection timed out)]
pveber has left #ocaml []
pveber has joined #ocaml
Yoric[DT] has joined #ocaml
<flx__> hmm.. I'm looking at the specification (/documentation) of Unix.write
<flx__> how does it work in a non-blocking situation?
<flx__> am I to read is so that it keeps retrying writing the block even if it has succeeded in writing it in part?
<flx__> if so, I have some code to fix :)
<flx__> for reference, here's the documentation:
<flx__> write fd buff ofs len writes len characters to descriptor fd , taking them from string buff , starting at position ofs in string buff . Return the number of characters actually written. write repeats the writing operation until all characters have been writ- ten or an error occurs.
<flx__> I mean, if it first has written a part and then writing would return EWOULDBLOCK because, well, the (in my case) socket would block..
rwmjones-lunch is now known as rwmjones
* Yoric[DT] doesn't have a clue how I/O works in non-blocking situations.
<flx__> so I suppose I should always use Unix.single_write when non-blocking sockets are used
<flx__> ah: if (ret == -1) { if ((errno == EAGAIN || errno == EWOULDBLOCK) && written > 0) break; ..
<flx__> so I guess I should be safe
<flx__> but one other thing that pops to me: Unix.write uses memmove and a separate iobuf :-o
<flx__> I guess it must do that, because gc might move the buffer around during the write..
<flx__> which is a shame
<flx__> maybe someone should write a block shoveling library for ocaml that would avoid such copies ;)
<flx__> (I don't know if it matters to the performance in the slightest, but I suppose it might, if you've shoveling data from one gigabit-link to another)
aldebrn has quit ["User disconnected"]
aldebrn has joined #ocaml
svenl has joined #ocaml
flx__ is now known as flux
tmaedaZ is now known as tmaeda
julm has joined #ocaml
willb has joined #ocaml
bscofield has quit ["Leaving..."]
julm_ has quit [Read error: 110 (Connection timed out)]
jimmyb2187 has joined #ocaml
LeCamarade is now known as LeCamarade|Away
bombshelter13_ has joined #ocaml
bscofield has joined #ocaml
acatout has joined #ocaml
BiDOrD has quit [Remote closed the connection]
BiDOrD has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
bzzbzz has joined #ocaml
Amorphous has joined #ocaml
BiDOrD has quit [Read error: 104 (Connection reset by peer)]
Associat0r has joined #ocaml
Associat0r has quit []
_zack has quit ["Leaving."]
BiDOrD has joined #ocaml
pr has joined #ocaml
rbancroft has quit [Read error: 104 (Connection reset by peer)]
rbancroft has joined #ocaml
<mfp> flux: IIRC Jane St. core does that, with bigarrays
<mfp> I've also seen some Unix.write-like function without enter_blocking_section & a separate buffer, somewhere
Cromulent has joined #ocaml
BiDOrD has quit [Read error: 110 (Connection timed out)]
BiDOrD has joined #ocaml
<flux> mfp, there's a way to handle bigarrays with write/read?
<mfp> flux: IIRC they have built their IO stuff on top of (char, int8_unsigned_elt, c_layout) Array1.t arrays
<mfp> with some code in C, including Linux-specific functionality
<mfp> here it is, type Bigstring.t = (char, int8_unsigned_elt, c_layout) Array1.t
<mfp> then things like external unsafe_write : file_descr -> pos : int -> len : int -> t -> int = "bigstring_write_stub"
<flux> it really wouldn't need to be unsafe?
Cromulent has quit []
<mfp> they have safe versions, written in OCaml, based on the unsafe ones in C
<flux> ah, ok
<mfp> it seems to be relatively self-contained; you can steal bigstring.ml, bigstring_stubs.c & a few .h files, and use it under LGPL + linking exn
Asmadeus has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
julm has quit ["tayo !"]
tmaeda is now known as tmaedaZ
mbishop_ is now known as mbishop
Cromulent has joined #ocaml
Cromulent has left #ocaml []
bscofield has quit ["Leaving..."]
onigiri has joined #ocaml
mdmkolbe has joined #ocaml
<mdmkolbe> Does O'Caml allow multiple-clause pattern matching of fuction arguments (e.g. like in Haskell "f (x:y) = y; f [] = []")? I realize it can be built by directly using match, but that gets verbose after a while. (I'm a long time Haskell user, but a first time O'Caml user.)
<thelema> sorry, ocaml functions are defined in one place - no piecewise definitions
<thelema> the easiest way to do what you're trying is:
<thelema> let f = function x::y -> y | [] -> []
<mdmkolbe> thanks, thelema
bscofield has joined #ocaml
Narrenschiff has joined #ocaml
bscofield has quit [Client Quit]
julm has joined #ocaml
<mdmkolbe> What is a good (commonly used) o'caml repl that understands things like arrow keys, etc.? (Running just "ocaml" doesn't seem to understand arrow keys, but maybe I'm just mis-configured.)
<_andre> mdmkolbe: you can install rlwrap and run "rlwrap ocaml"
Yoric[DT] has joined #ocaml
<flux> mdmkolbe, in addition to that you may want to use ocaml directly from emacs, if you happen to use it
<mdmkolbe> flux: I do use emacs, but it looks like the ocaml mode isn't installed ("M-x caml<TAB>" and "M-x ocaml<TAB>" show no commands), so I'll have to look into how hard it is to install ocaml mode.
<flux> mdmkolbe, you want to install tuare-mode too
<flux> you want to have caml-types.el (from ocaml-mode) around though, when using it
<flux> that way you get type-throwback with emacs. and that is one great feature!
<mdmkolbe> type-throwback?
Jeff_123 has joined #ocaml
Jeff_123 has quit [Client Quit]
<flux> you point a value, hit C-c C-t and you get its type back
<flux> so if you have let foo a b = a + b, and you point for example the latter a, hitting the combo will give you 'int'
<flux> or hitting foo will give you int -> int -> int etc
<flux> it can be precious when you have a are having typing issues..
<_andre> btw, vim's ocaml mode has that too if you press \t
slash_ has joined #ocaml
<_andre> i only found that out the other day :)
Ched has quit [Remote closed the connection]
Hadaka has quit [wolfe.freenode.net irc.freenode.net]
Hadaka has joined #ocaml
jonafan_ is now known as jonafan
Narrenschiff has quit [Read error: 110 (Connection timed out)]
Ched has joined #ocaml
mbishop has quit [Read error: 110 (Connection timed out)]
pr_ has joined #ocaml
svenl has quit [Remote closed the connection]
svenl has joined #ocaml
ulfdoz has joined #ocaml
bluestorm has joined #ocaml
pr has quit [Read error: 101 (Network is unreachable)]
bscofield has joined #ocaml
mbishop has joined #ocaml
jonafan_ has joined #ocaml
robocop1 has joined #ocaml
Ched has quit [wolfe.freenode.net irc.freenode.net]
_andre has quit [wolfe.freenode.net irc.freenode.net]
jonafan has quit [wolfe.freenode.net irc.freenode.net]
_andre has joined #ocaml
Ched has joined #ocaml
jonafan has joined #ocaml
mbishop has quit [Connection timed out]
sgnb` has joined #ocaml
mbishop has joined #ocaml
hkBst has quit [Broken pipe]
Hydrant has quit [Success]
sgnb has quit [Remote closed the connection]
Hydrant has joined #ocaml
hkBst has joined #ocaml
jonafan has quit [SendQ exceeded]
jonafan_ is now known as jonafan
f[x] has quit [Read error: 110 (Connection timed out)]
ulfdoz has quit [Read error: 145 (Connection timed out)]
Beelsebob has quit ["Leaving."]
Beelsebob has joined #ocaml
bzzbzz has quit ["leaving"]
hkBst has quit [Read error: 104 (Connection reset by peer)]
hkBst has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
pr_ is now known as pr
_andre has quit ["Lost terminal"]
bombshelter13_ has quit []
Camarade_Tux has quit [Remote closed the connection]
Asmadeus has quit [Remote closed the connection]
thelema__ has quit [Read error: 110 (Connection timed out)]
hkBst has quit [Read error: 104 (Connection reset by peer)]
Camarade_Tux has joined #ocaml
bscofield has quit []
<robocop1> hello
<robocop1> do you know if is there a correct recent building of sfml in ocaml ?
<robocop1> if possible with OO.
<robocop1> *binding
thrasibule has joined #ocaml
<hcarty> robocop1: I think the library has been mentioned here before. But I don't know of any OCaml bindings.
<robocop1> hum, okey
Camarade_Tux has quit [Remote closed the connection]
<robocop1> but I don't what it worth
<robocop1> and it's not OO
<hcarty> The last update is quite recent
willb has quit [Read error: 110 (Connection timed out)]
<hcarty> Why is the lack of OO a problem? You could OOify it if you like.
<robocop1> sfml is a OO project
<robocop1> ocaml support OO, why don't use it ?
<hcarty> I would guess that the bindings use the C interface. That is just a guess though.
<hcarty> The author may prefer not to use the OO support in OCaml
<robocop1> yes, perhaps
<robocop1> but he use c++ : "Il s'appuie tout d'abord sur la SFML (version C++)"
<hcarty> It says it requires the C interface as well (according to Google's translation...)
<hcarty> Binding a C library is often much simpler than binding a C++ library, at least with OCaml.
<robocop1> ha yes you right
<robocop1> thanks for your help
robocop1 has quit [Remote closed the connection]
<hcarty> You're welcome. Thank you for pointing out the bindings :-)
thrasibule has quit [Read error: 110 (Connection timed out)]
adrien has joined #ocaml
adrien is now known as Camarade_Tux
thrasibule has joined #ocaml
Beelsebob has quit ["Leaving."]
Makoryu has left #ocaml []
xevz_ has joined #ocaml
xevz has quit [Read error: 131 (Connection reset by peer)]
willb has joined #ocaml