adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml MOOC http://1149.fr/ocaml-mooc | OCaml 4.02.3 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
dhil has quit [Quit: Leaving]
toomuchtvrotsurb has quit [Remote host closed the connection]
johnf__ has joined #ocaml
nullcatxxx_ has quit [Ping timeout: 240 seconds]
nullcatxxx_ has joined #ocaml
johnf__ has quit [Ping timeout: 240 seconds]
johnf_ has quit [Ping timeout: 272 seconds]
ollehar2 has quit [Remote host closed the connection]
jeffmo has joined #ocaml
Mike57 has quit [Ping timeout: 240 seconds]
mort___ has quit [Quit: Leaving.]
Denommus has quit [Quit: going home]
Mike57 has joined #ocaml
wagle has joined #ocaml
Algebr`` has quit [Remote host closed the connection]
wagle has quit [Remote host closed the connection]
Kakadu has quit [Remote host closed the connection]
wagle has joined #ocaml
lolisa has joined #ocaml
madroach has quit [Ping timeout: 246 seconds]
Sorella has quit [Quit: Connection closed for inactivity]
madroach has joined #ocaml
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
johnf has joined #ocaml
wagle has quit [Ping timeout: 240 seconds]
toomuchtvrotsurb has joined #ocaml
nullcatxxx_ has quit [Read error: Connection reset by peer]
Mike57 has quit [Ping timeout: 250 seconds]
nullcatxxx_ has joined #ocaml
Mike57 has joined #ocaml
ril has joined #ocaml
Mike57 has quit [Ping timeout: 272 seconds]
Mike57 has joined #ocaml
wagle has joined #ocaml
Mike57 has quit [Ping timeout: 240 seconds]
wagle has quit [Ping timeout: 240 seconds]
nullcatxxx_ has quit [Read error: Connection reset by peer]
nullcatxxx_ has joined #ocaml
kandu has joined #ocaml
Algebr has joined #ocaml
Algebr is now known as Guest5179
Mike57 has joined #ocaml
Major_Biscuit has quit [Quit: WeeChat 1.3]
groovy2shoes has joined #ocaml
Mike57 has quit [Ping timeout: 250 seconds]
<Guest5179> How can I take two items at a time from a list
FreeBirdLjj has joined #ocaml
Mike57 has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
nullcatxxx_ has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
nullcatxxx_ has joined #ocaml
wagle has joined #ocaml
Mike57 has quit [Ping timeout: 240 seconds]
Mike57 has joined #ocaml
badon has quit [Quit: Leaving]
eikke has quit [Remote host closed the connection]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
basus has joined #ocaml
<basus> Hi, I'm using Oasis to build my project and I'm wondering how to change the name of the executable
<basus> It seems to use the filename specified in MainIs with a .native extension, but I'd like to haveit called something else
tokik has quit [Quit: leaving]
tokik has joined #ocaml
jeffmo has quit [Quit: jeffmo]
<Guest5179> when you do make install it will be the correct name as was in the _oasis file
basus_ has joined #ocaml
sheijk has quit [Ping timeout: 276 seconds]
sheijk has joined #ocaml
basus has quit [Ping timeout: 252 seconds]
<basus_> Is there some way to change it without doing `make install`?
lyxia has quit [Remote host closed the connection]
lyxia has joined #ocaml
<Guest5179> I don't know, what's the point though? You can just go to the _build, find your exectuable and rename it something else.
<basus_> it's just a small UI issue
<Guest5179> I suppose you can do it with a PostBuildCommand: in _oasis
<Guest5179> and then somethign like : mv _build/foo bar
agumonkey has quit [Quit: ZNC - http://znc.in]
<basus_> the PostBuildCommand seems to work, but I wish it's something I could specify on a per-exe basis. Maybe I'll file a bug report
<basus_> the PostBuildCommand seems to work, but I wish it's something I could specify on a per-exe basis. Maybe I'll file a bug report
agumonkey has joined #ocaml
<Guest5179> okay, better than bug reports are PRs... :)
struktured has joined #ocaml
Mike57 has quit [Ping timeout: 240 seconds]
<fds> Guest5179: You know all that, but you can't pattern match two items from a list..?
Guest5179 has quit [Remote host closed the connection]
Mike57 has joined #ocaml
cody` has quit [Quit: Connection closed for inactivity]
agumonkey has quit [Ping timeout: 250 seconds]
basus_ has quit [Ping timeout: 252 seconds]
struk|desk|away has quit [Remote host closed the connection]
igoroliveira has quit [Quit: Connection closed for inactivity]
infinity0 has quit [Ping timeout: 250 seconds]
Mike57 has quit [Ping timeout: 240 seconds]
f[x] has quit [Ping timeout: 250 seconds]
Bahman has joined #ocaml
cody` has joined #ocaml
struktured has quit [Ping timeout: 256 seconds]
BitPuffin|osx has quit [Ping timeout: 272 seconds]
wolfcore has joined #ocaml
Mike57 has joined #ocaml
Bahman has quit [Read error: Connection reset by peer]
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jerith has quit [Remote host closed the connection]
Bahman has joined #ocaml
Mike57 has quit [Ping timeout: 240 seconds]
struk|desk has joined #ocaml
_habnabit has quit [Remote host closed the connection]
ncthom91 has joined #ocaml
<profan> ello ocamlers, what would you guys recommend as far as PEG parser generators go in OCaml? i've found aurochs at least, is this still what to go for?
_habnabit has joined #ocaml
mac10688 has quit [Ping timeout: 272 seconds]
groovy2shoes has quit [Quit: Leaving]
ggole has joined #ocaml
ril has joined #ocaml
ggole_ has joined #ocaml
Mike57 has joined #ocaml
ggole has quit [Ping timeout: 256 seconds]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ggole_ has quit [Ping timeout: 256 seconds]
ldopa has quit [Ping timeout: 250 seconds]
psy_ has quit [Ping timeout: 240 seconds]
MercurialAlchemi has joined #ocaml
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Mike57 has quit [Ping timeout: 272 seconds]
Mike57 has joined #ocaml
struk|desk is now known as struk|desk|away
psy_ has joined #ocaml
contempt has quit [Ping timeout: 256 seconds]
Mike57 has quit [Ping timeout: 250 seconds]
contempt has joined #ocaml
AlexRussia has quit [Ping timeout: 272 seconds]
MercurialAlchemi has quit [Ping timeout: 272 seconds]
antkong_ has joined #ocaml
MercurialAlchemi has joined #ocaml
ggole_ has joined #ocaml
ldopa has joined #ocaml
mcint has quit [Quit: mcint]
ggole__ has joined #ocaml
kushal has joined #ocaml
Mike57 has joined #ocaml
ggole_ has quit [Ping timeout: 240 seconds]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nullcatxxx_ has joined #ocaml
psy_ has quit [Quit: Leaving]
darkf has joined #ocaml
kushal has quit [Remote host closed the connection]
lostman has quit [Quit: Connection closed for inactivity]
cody` has quit [Quit: Connection closed for inactivity]
kushal has joined #ocaml
antkong_ has quit [Quit: antkong_]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ldopa has quit [Ping timeout: 240 seconds]
nullcatxxx_ has joined #ocaml
JacobEdelman has quit [Quit: Connection closed for inactivity]
Mike57 has quit [Ping timeout: 240 seconds]
larhat1 has quit [Quit: Leaving.]
kushal has quit [Quit: Leaving]
Mike57 has joined #ocaml
kushal has joined #ocaml
f[x] has joined #ocaml
zpe has joined #ocaml
jerith has joined #ocaml
Mike57 has quit [Ping timeout: 250 seconds]
Mike57 has joined #ocaml
jeffmo has joined #ocaml
jeffmo has quit [Client Quit]
kushal has quit [Ping timeout: 250 seconds]
Bahman has quit [Read error: Connection reset by peer]
Bahman has joined #ocaml
Mike57 has quit [Ping timeout: 272 seconds]
Mike57 has joined #ocaml
Haudegen has quit [Ping timeout: 272 seconds]
Bahman has quit [Ping timeout: 256 seconds]
damason has quit [Ping timeout: 256 seconds]
Haudegen has joined #ocaml
M-Illandan has quit [Write error: Connection reset by peer]
Mike57 has quit [Ping timeout: 256 seconds]
sbrouf_ has joined #ocaml
ianhedoesit has quit [Quit: leaving]
Mike57 has joined #ocaml
Mike57 has quit [Ping timeout: 256 seconds]
Mike57 has joined #ocaml
Mercuria1Alchemi has joined #ocaml
M-Illandan has joined #ocaml
Mike57 has quit [Ping timeout: 240 seconds]
Simn has joined #ocaml
Bahman has joined #ocaml
toomuchtvrotsurb has quit [Remote host closed the connection]
ely-se has joined #ocaml
Mike57 has joined #ocaml
struktured has joined #ocaml
ely-se has quit [Ping timeout: 240 seconds]
rand has joined #ocaml
ely-se has joined #ocaml
ygrek_ has joined #ocaml
toomuchtvrotsurb has joined #ocaml
Anarchos has joined #ocaml
f[x] has quit [Ping timeout: 250 seconds]
toomuchtvrotsurb has quit [Ping timeout: 240 seconds]
lolisa has quit [Quit: meow]
ggole__ is now known as ggole
Anarchos has quit [Quit: reconnecting from haiku]
ggole has quit [Ping timeout: 250 seconds]
Anarchos has joined #ocaml
toomuchtvrotsurb has joined #ocaml
toomuchtvrotsurb has quit [Ping timeout: 240 seconds]
troydm has quit [Ping timeout: 246 seconds]
Anarchos_ has joined #ocaml
Anarchos has quit [Ping timeout: 252 seconds]
ggole has joined #ocaml
ygrek_ has quit [Ping timeout: 240 seconds]
ggole_ has joined #ocaml
ggole has quit [Ping timeout: 240 seconds]
Anarchos_ has quit [*.net *.split]
toomuchtvrotsurb has joined #ocaml
sbrouf_ has quit [Ping timeout: 250 seconds]
troydm has joined #ocaml
toomuchtvrotsurb has quit [Ping timeout: 256 seconds]
sbrouf_ has joined #ocaml
Mike57 has quit [Ping timeout: 240 seconds]
sh0t has joined #ocaml
Mike57 has joined #ocaml
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pothepanda has quit [Quit: Leaving]
sbrouf_ has quit [Ping timeout: 250 seconds]
Bahman has quit [Read error: Connection reset by peer]
Major_Biscuit has joined #ocaml
Bahman has joined #ocaml
ely-se has quit [Quit: leaving]
ely-se has joined #ocaml
mcint has joined #ocaml
ely-se has quit [Quit: leaving]
ely-se has joined #ocaml
toomuchtvrotsurb has joined #ocaml
toomuchtvrotsurb has quit [Ping timeout: 272 seconds]
mcint has quit [Quit: mcint]
fedjo has joined #ocaml
Mike57_ has joined #ocaml
Mike57 has quit [Ping timeout: 272 seconds]
fedjo has left #ocaml [#ocaml]
Bahman has quit [Read error: Connection reset by peer]
Mike57_ has quit [Ping timeout: 240 seconds]
toomuchtvrotsurb has joined #ocaml
sbrouf_ has joined #ocaml
mcmillhj has quit [Ping timeout: 250 seconds]
Mike57 has joined #ocaml
toomuchtvrotsurb has quit [Ping timeout: 256 seconds]
Haudegen has quit [Ping timeout: 240 seconds]
<sspi> any good examples of calling something from a OSX system framework in OCaml?
antkong_ has joined #ocaml
troydm has quit [Ping timeout: 246 seconds]
dsheets_ has joined #ocaml
Haudegen has joined #ocaml
toomuchtvrotsurb has joined #ocaml
toomuchtvrotsurb has quit [Ping timeout: 272 seconds]
bugabinga has quit [Remote host closed the connection]
thesnowdog1 has quit [Read error: Connection reset by peer]
bugabinga has joined #ocaml
thesnowdog1 has joined #ocaml
troydm has joined #ocaml
sbrouf_ has quit [Ping timeout: 240 seconds]
toomuchtvrotsurb has joined #ocaml
FreeBirdLjj has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
troydm has quit [Ping timeout: 246 seconds]
malc_ has joined #ocaml
struktured has quit [Ping timeout: 240 seconds]
troydm has joined #ocaml
mcint has joined #ocaml
toomuchtvrotsurb has quit [Ping timeout: 256 seconds]
mcint has quit [Quit: mcint]
mcint has joined #ocaml
ely-se has quit [Quit: leaving]
mcint has quit [Quit: mcint]
troydm has quit [Ping timeout: 246 seconds]
troydm has joined #ocaml
infinity0 has joined #ocaml
Sorella has joined #ocaml
toomuchtvrotsurb has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
mort___ has joined #ocaml
rand has quit [Ping timeout: 240 seconds]
Haudegen has joined #ocaml
toomuchtvrotsurb has quit [Remote host closed the connection]
<Drup> profan: the go to parser generator in ocaml in menhir, but it's not PEG.
antkong_ has quit [Quit: antkong_]
freehck has joined #ocaml
troydm has quit [Ping timeout: 246 seconds]
ely-se has joined #ocaml
toomuchtvrotsurb has joined #ocaml
ely-se has quit [Quit: leaving]
toomuchtvrotsurb has quit [Ping timeout: 256 seconds]
pierpa has joined #ocaml
dsheets_ has quit [Ping timeout: 256 seconds]
dsheets_ has joined #ocaml
troydm has joined #ocaml
jonludlam has joined #ocaml
ely-se has joined #ocaml
sbrouf_ has joined #ocaml
dsheets_ has quit [Ping timeout: 250 seconds]
mort___ has quit [Quit: Leaving.]
rand has joined #ocaml
AlexRussia has joined #ocaml
mcint has joined #ocaml
sbrouf_ has quit [Quit: Quitte]
NaCl has left #ocaml [#ocaml]
mcint has quit [Quit: mcint]
d0nn1e has quit [Ping timeout: 272 seconds]
d0nn1e has joined #ocaml
dsheets_ has joined #ocaml
Haudegen has quit [Ping timeout: 250 seconds]
BitPuffin has joined #ocaml
ely-se has quit [Quit: leaving]
ely-se has joined #ocaml
Haudegen has joined #ocaml
tane has joined #ocaml
ldopa has joined #ocaml
troydm has quit [Ping timeout: 246 seconds]
troydm has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
ely-se has quit [Quit: leaving]
gargawel has quit [Remote host closed the connection]
Drup has quit [Quit: Tatayoyo]
gargawel has joined #ocaml
Drup has joined #ocaml
zpe has quit [Remote host closed the connection]
ely-se has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
Simn has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
hay207__ has joined #ocaml
ely-se has quit [Quit: leaving]
<hay207__> hi guys, after installing ocaml repository for ubuntu, some pacakages (as ocaml-findlib) won't install
<freehck> hay207__: bad news for ubuntu users.
<hay207__> i m thinking of downgrading ocaml from 4.02 to 4.01
<flux> hay207__, you should consider just using the default ubuntu ocaml for installing opam and use opam from thereon
<freehck> hay207__: why don't you install ubuntu's opam?
<freehck> hay207__: you could then switch your ocaml version in userspace by fly.
<hay207__> ok, so i downgrade then,
<hay207__> i was following the install instructions in opam wiki freehck
<freehck> hay207__: what's your ubuntu release?
Anarchos_ has joined #ocaml
<hay207__> 14.04
<freehck> The instructions on that page were concerned only 14.10
<freehck> So downgrade and use instructions for Debian. :)
mcint has joined #ocaml
ely-se has joined #ocaml
mcint has quit [Client Quit]
mcint has joined #ocaml
mcint has quit [Client Quit]
FreeBirdLjj has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 250 seconds]
ely-se has quit [Quit: leaving]
Haudegen has quit [Ping timeout: 265 seconds]
sbrouf has joined #ocaml
<freehck> people, if I start a child process with open_process_full, could I get child's pid some way?
<hay207__> downgrading requires removing the repository first, how to edit ocaml wiki guys?
<hay207__> i want to edit ubuntu instructions
<freehck> hay207__: nonsense.
<companion_cube> freehck: I don't think so, sadly :(
<companion_cube> now I use create_process
Mercuria1Alchemi has quit [Ping timeout: 256 seconds]
<companion_cube> and I manage pipes by hand...
<freehck> hay207__: it's not APT manual. Of course you need either to remove repo, or to pin packages, or to specify the appropriate repo.
<hay207__> ok ok
ely-se has joined #ocaml
<freehck> hay207__: and in your specific case I'd rather remove these packages first, and then remove the repo.
Haudegen has joined #ocaml
<edwin> does ubuntu 14.04 have the broken opam though?
<hay207__> anyway i need to reinit opam after downgrading
<edwin> I know the page says its broke n in 14.10, and I know it was broken in debian unstable at some point, but don't know about 14.04
<freehck> hay207__: had a sense.
dsheets_ has quit [Ping timeout: 240 seconds]
<hay207__> edwin: opam installed in my system correctly,
<hay207__> i don't know what you mean by broken!
<freehck> companion_cube: btw, create_process is a cool thing. I've written the function to read all the file descriptors simultaneously in order to not hang up pipes.
<freehck> But it's possible to write it only when you're working with file descriptors.
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
ely-se has quit [Quit: leaving]
<edwin> hay207__: broken in the sense that there was a problem with the dependency resolver https://bugs.launchpad.net/ubuntu/+source/opam/+bug/1401346
ely-se has joined #ocaml
<edwin> the initial release of opam 1.1.1 worked though
<edwin> so if thats what 14.04 has then it should be good
ggole_ is now known as ggole
FreeBirdLjj has quit [Remote host closed the connection]
<freehck> companion_cube: well iiuc I need to create descriptors manually for create_process?
<companion_cube> yes
<companion_cube> :(
<freehck> hm... I don't see functions to create descriptors. I could use open_out and then descr_of_out_channel?
<freehck> Well, I think it's fine too.
<edwin> Unix.openfile?
<ggole> Or pipe
<ggole> Which is probably what you want if you are messing about with children
<freehck> Oh... Pipes. Of course...
strmpnk has quit [Ping timeout: 250 seconds]
strmpnk has joined #ocaml
kushal has joined #ocaml
ncthom91 has joined #ocaml
ril has joined #ocaml
dsheets_ has joined #ocaml
<companion_cube> freehck: Unix.pipe, yeah
<sbrouf> how would i go to specialize a module, say BatMap ?
<companion_cube> http://paste.isomorphis.me/UTj I have something like this for the process
<companion_cube> sbrouf: BatMap.Make(SomeOtherModule), I guess?
<sbrouf> I mean, I want to add some functions in the BatMap module
<companion_cube> oh.
<sbrouf> for a special type of values, so I don't think this would be enough companion_cube
<ggole> module MapWithJunk = struct include BatMap let my_junk = Obj.magic "zonk" end
<companion_cube> yeah, but don't Obj.magic
<sbrouf> yes I got that ^^
<sbrouf> thank you !
<ely-se> what's Obj.magic?
<ggole> Something you should never use
<ggole> Check the type.
<ely-se> unsafeCoerce
<ely-se> cool
<ely-se> I should use that
* Anarchos_ sigh**
<Anarchos_> jpdeplaix: hi
<ggole> Obj is nice for fun programming like https://gist.github.com/643d706c629025320fa0
<companion_cube> fun time that ends in segfault
<ggole> I think I wrote this on a 32-bit machine, I'm sure it ends badly on x86-64 (or anything else)
<Anarchos_> ggole: what does it do ?
<freehck> companion_cube: I'm stucked with create_process description. I's written "the new process executes concurrently with the current process". I don't understand it. Why concurrently? I thought it should be in parallel.
<companion_cube> yeah yeah
<companion_cube> it just means that the call doesn't block until the sub-process terminates
<freehck> thx
<companion_cube> guess the doc was written when most processors were 1-core
<ggole> Extends a string in place by overwriting the last word (and making all kinds of unjustified assumptions about the implementation).
Haudegen has quit [Ping timeout: 260 seconds]
dsheets_ has quit [Ping timeout: 256 seconds]
Mike57 has quit [Ping timeout: 256 seconds]
Mike57 has joined #ocaml
<jpdeplaix> Anarchos_: hi
dsheets_ has joined #ocaml
<freehck> companion_cube: is this realisation of async_command fine? http://pastebin.com/bL4WQTvG
<freehck> *realization
* Anarchos_ is thinking that ocaml is a language of choice to write a decompiler.
<companion_cube> I'm not sure you should close the filedescrs, freehck
<companion_cube> otherwise it looks good, superficially
<companion_cube> I'm no unix expert, sadly
<Anarchos_> ggole: why the Gc.minor ?
<ggole> Anarchos_: to ensure a crash if the value was ill formed
<Anarchos_> ok
<ggole> freehck: you'll leak some fds if something throws an exception
ely-se has quit [Quit: leaving]
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
infinity0 has quit [Ping timeout: 240 seconds]
tane has quit [Quit: Verlassend]
Haudegen has joined #ocaml
slash^ has joined #ocaml
ril has joined #ocaml
toomuchtvrotsurb has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
ely-se has joined #ocaml
<freehck> ggole: I thought the same way. First of all I should use "try" to close fds if create_process fails. And most of all I'm interested in is: if I only pass descriptors to create_process, who will close the pipe descriptors which the child doesn't use?
<freehck> Oh, it seems that a simple fork have a more predictable behaviour.
<freehck> *has
infinity0 has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
<freehck> Btw, according to Unix module documentation the call Unix.fork will return 0 for child branch, positive number for parent branch. But the appropriate system call could also return a negative number in case of fork error. Will the Unix.fork raise an exception in this case or just return a negative integer?
<freehck> Ah, I see. it will raise Unix_error.
<ggole> All the unix stuff raises on error
<ggole> The way to deal with this nicely is to write the analogue of try ... with ... finally and use that for each fd
Mike57 has quit [Ping timeout: 240 seconds]
<freehck> ggole: oh... I got. The error could happen even when I call Unix.pipe. :)
Mike57 has joined #ocaml
<ggole> Yeah
<ggole> You really don't want to have to write each possible nested path by hand.
<freehck> ggole: do you see the more right way?
<ggole> The try ... with ... finally analogue that I suggested? Or did you mean in some other sense?
<freehck> Ah, I got you.
sbrouf has quit [Ping timeout: 265 seconds]
sbrouf has joined #ocaml
sbrouf has quit [Ping timeout: 240 seconds]
JacobEdelman has joined #ocaml
Mike57 has quit [Ping timeout: 240 seconds]
Mike57 has joined #ocaml
rand has quit [Quit: leaving]
<reynir> Sometimes I'm tempted to do sed -i s/transpile/compile/g and do a pull request when I see that on github :|
<reynir> (sorry, off-topic)
<rks`> that's because you're getting old reynir
<rks`> nowadays people would call njsed, not sed.
<Anarchos_> rks`: njsed ?
<rks`> nodejs sed
<freehck> ggole: maybe this variant of async_command would be better? http://pastebin.com/9zpd7VDM
<freehck> Hm... I forgot, should an array for exec* system calls end with NULL?
ely-se has quit [Quit: leaving]
<freehck> Well, I suppose it's not necessary with ocaml.
<freehck> It'd be strange, wouldn't it?
<edwin> I have a wrapper function, called do_with in this example: http://paste.debian.net/346944/
<edwin> thats for simple things, in reality you probably want to log the error from the finally instead of ignoring
MercurialAlchemi has joined #ocaml
malc_ has quit [Remote host closed the connection]
govg has joined #ocaml
<freehck> Oh, people, I feel like I'm C programmer. :)
Simn has joined #ocaml
tane has joined #ocaml
larhat has quit [Read error: No route to host]
larhat has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
psy_ has joined #ocaml
psy_ has quit [Max SendQ exceeded]
psy_ has joined #ocaml
struk|desk|away is now known as struk|desk
mort___ has joined #ocaml
mort___ has quit [Client Quit]
Haudegen has joined #ocaml
Mike57 has quit [Ping timeout: 240 seconds]
Mike57 has joined #ocaml
Denommus has joined #ocaml
Anarchos_ has quit [Quit: Page closed]
toomuchtvrotsurb has quit [Remote host closed the connection]
toomuchtvrotsurb has joined #ocaml
ollehar has joined #ocaml
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
^elyse^ has joined #ocaml
ggole has quit [Ping timeout: 256 seconds]
Major_Biscuit has quit [Quit: WeeChat 1.3]
toomuchtvrotsurb has quit [Remote host closed the connection]
sbrouf has joined #ocaml
toomuchtvrotsurb has joined #ocaml
ril has joined #ocaml
ygrek_ has joined #ocaml
nullcatxxx_ has joined #ocaml
larhat1 has joined #ocaml
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jeffmo has joined #ocaml
dsheets_ has quit [Ping timeout: 265 seconds]
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
BitPuffin has quit [Ping timeout: 256 seconds]
^elyse^ has quit [Quit: Leaving]
sbrouf has quit [Read error: Connection reset by peer]
ril has joined #ocaml
Kakadu has joined #ocaml
sbrouf has joined #ocaml
<sbrouf> how would you split a library into multiple files (in the same folder) so that you could compile it with oasis ?
<edwin> there is Modules: and InternalModules: where you can list them
<edwin> every module that you want to access from outside the library should go into Modules:
<edwin> there is also a way to pack multiple submodules into a single one but thats more complicated to set up
<sbrouf> ok so I can just put multiple files in a folder, and give an argument to Modules for each of them ?
<sbrouf> I don't know why I coulnd't do it, but it now seems to work ^^
<sbrouf> thank you edwin
<edwin> yes
<edwin> separate them with commas
<edwin> in fact if you don't declare the internalmodules it'll still build but you'll get some errors when you try to use the library from the outside
<sbrouf> ok
<edwin> please try to give your modules somewhat unique names though if you intend others to use it
antkong_ has joined #ocaml
<edwin> because you can't have multiple modules with same name linked into an app
<edwin> (even if they are part of different libs)
<sbrouf> oh ok that's why the CC and Bat
<sbrouf> but well for now what i'm doing is still quite in a state of draft...
<edwin> yeah or other solution like packing modules or namespaces
<sbrouf> yep
Algebr has joined #ocaml
Algebr is now known as Guest5794
Guest5794 is now known as Algebr`
BitPuffin has joined #ocaml
groovy2shoes has joined #ocaml
<Algebr`> Using Lwt to read from a unix socket but sometimes the socket gets too much data and my code's Lwt_io.read call raises End_of_file because the other side isn't able to provide data. What can I do on my side of the code about this?
groovy2shoes has quit [Changing host]
groovy2shoes has joined #ocaml
<edwin> docs say it returns "" for eof, so don't read more data after you get that
<edwin> if the other side is not able to provide data it should just suspend the Lwt thread, not raise eof though
<Algebr`> so something like if given "" then Lwt_main.yield, else keep going?
<edwin> well you should only get "" on eof, if you get it earlier something is wrong
<edwin> did you try to use strace to find out what happens exactly? could be that its just a broken pipe due to a timeout or something
<Algebr`> Was also looking at Lwt_throttle. will try now.
<Algebr`> yes, somethign is wrong, the other side isn't able to produce as much data as it said it would
<Algebr`> because it itself is getting overwhelmed, but my code ought to handle that because the other side might be able to recover later on.
<edwin> mind you socket reads *can* return less bytes than what you asked for, not sure if Lwt_io.read would help you out
<edwin> so you can ask it to give you up to 16k for example, and it only gives you 10 bytes (because thats all it had at the time)
<edwin> if there are no bytes available it'll block until there is some bytes available
<edwin> the usual way to do it is that you ask it to read N bytes, and check if you got less than N (but more than 0)
<edwin> if yes you call read again for the remainder
<edwin> if you got 0 then its eof
<edwin> if you know exactly how much data you will have you can try read_into_exactly
<Algebr`> edwin: okay, this is where it dies http://pastebin.com/ZG08Xrsa
slash^ has quit [Read error: Connection reset by peer]
<edwin> read(4, "+\1\0\0\1\0\0\0\10\0\0\0\0\0\0\0<?xml version=\"1"..., 4096) = 299
<edwin> it asked for 4k but got only 299
<Algebr`> odd, I don't explicity ask for 4096, I only read as much as the other side tells me the total size is...maybe the other side got overwhelmed and gave me junk data? Its usb devices that write to a unix socket when they are plugged in, I'm plugging in liek 10 at a time
<Algebr`> and want it to work
<flux> ..and afterwards it says read(4,.. = 0 and the socket is then disconnected
<edwin> you should use read_into_exactly with the total size
toomuchtvrotsurb has quit [Remote host closed the connection]
<Algebr`> flux: is it disconnected from my side or the otherside?
<flux> from the other side
<flux> algebr`, have you tried playing with it using socat?
<edwin> yeah quite possible you got junk data if you don't repeat the reads, think of it this way
<flux> socat unix-connect:foo.sock -
<flux> it seems to me it disconnects by itself
<Algebr`> edwin: but read takes a count argument which I'm providing.
toomuchtvrotsurb has joined #ocaml
<edwin> <size1><size 1 bytes...>; now you use read, but you get less than size1 bytes at a time; and then you read another size from the stream
<edwin> so you read the wrong count
<edwin> try printing the counts sent by the other side
<edwin> and the counts that you read
<flux> it's likely Lwt or something is doing its own stuff and doesn't blindly pass your count forward
<edwin> yeah I think it has an internal buffer
<Algebr`> thanks guys, will try out these ideas.
<edwin> also it might be useful to add some checksums or delimiters in the stream
<edwin> so if things do get out of sync you notice
<Algebr`> how can I do that, I don't control the other side
<edwin> and instead of eof you get an error saying that the count is invalid or the checksum is wrong
<edwin> aah, nm then
<edwin> thought you're writing your own proto between 2 of your apps
<edwin> capture the data sent by the other side with wireshark
<edwin> and print the counts read by your program
<edwin> and then check a few ones manually
<edwin> to see if they are right
<Algebr`> no, the other side is a daemon that writes to this unix socket whenever these devices are plugged in
<Algebr`> I don't control it...I mean I could fork it and mess with it but would much rather not.
<Algebr`> I also noticed that try%lwt is not acting the same as Lwt.on_failure
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
wolfcore has left #ocaml ["ERC (IRC client for Emacs 24.5.1)"]
^elyse^ has joined #ocaml
wolfcore has joined #ocaml
BitPuffin has quit [Ping timeout: 256 seconds]
struk|desk is now known as struk|desk|away
sbrouf has quit [Ping timeout: 240 seconds]
antkong_ has quit [Quit: antkong_]
struk|desk|away is now known as struk|desk
MercurialAlchemi has quit [Ping timeout: 260 seconds]
MercurialAlchemi has joined #ocaml
^elyse^ has quit [Quit: Leaving]
^elyse^ has joined #ocaml
^elyse^ has quit [Client Quit]
^elyse^ has joined #ocaml
freehck has quit [Remote host closed the connection]
cody` has joined #ocaml
toomuchtvrotsurb has quit [Remote host closed the connection]
jeffmo has quit [Quit: jeffmo]
jeffmo has joined #ocaml
JacobEdelman has quit [Quit: Connection closed for inactivity]
MercurialAlchemi has quit [Ping timeout: 260 seconds]
toomuchtvrotsurb has joined #ocaml
darkf has quit [Quit: Leaving]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
toomuchtvrotsurb has quit [Remote host closed the connection]
ygrek_ has quit [Ping timeout: 256 seconds]
struk|desk is now known as struk|desk|away
ncthom91 has joined #ocaml
ollehar has quit [Ping timeout: 255 seconds]
Anarchos has joined #ocaml
yallop has joined #ocaml
yallop has quit [Remote host closed the connection]
<nullcatxxx_> is there a way to refer to a variable in Makefile A from Makefile B
<nullcatxxx_> but we cannot include Makefile A directly
sbrouf has joined #ocaml
yallop has joined #ocaml
yallop has quit [Client Quit]
JacobEdelman has joined #ocaml
<edwin> can you use a common makefile included by both?
tane has quit [Quit: Verlassend]
<Algebr`> For Lwt_io.atomic, does that just mean that all the binds that I do in the callback will be done all together, guaranteed?
kushal has quit [Quit: Leaving]
<Algebr`> docs say sequence but odd, func doesn't take a list or something that has order, hence my prev comment
ygrek_ has joined #ocaml
Simn has quit [Quit: Leaving]
dfjskla has quit [Ping timeout: 256 seconds]
apache2 has quit [Remote host closed the connection]
jlouis has quit [Remote host closed the connection]
ahf has quit [Quit: Bye.]
ollehar has joined #ocaml
<Anarchos> Is there a noweb file to automate the recognition of ocaml keyword ?
<edwin> I think atomic here means that other io operation attemps on the same channel cannot be interleaved with it
<edwin> so the entire sequence of operations performed by 'f' is run as is, which can be a sequence of Lwt binds
<edwin> its as if you take a lock when entering atomic, run f on the channel and release it when done
dfjskla has joined #ocaml
ahf has joined #ocaml
<Algebr`> edwin: right, that's what I thought too. also, say I have a Bytes.t of length 16, how can I like take the first four bytes and get the decimal value of that int?
ollehar has quit [Ping timeout: 255 seconds]
hay207__ has quit [Ping timeout: 250 seconds]
mac10688 has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
apache2 has joined #ocaml
<fds> Is there any reason not to use Stog: http://zoggy.github.io/stog/ ? (E.g. the existence of superior alternatives)
ollehar has joined #ocaml
Major_Biscuit has joined #ocaml
ncthom91 has joined #ocaml
<edwin> Algebr`: take a look at ocplib-endian
demonimin has joined #ocaml
<Drup> fds: it's not very good.
<fds> Drup: What's better?
<fds> I like simple.
<Drup> then use one of the big well known one
<Drup> there is no reason to use something in OCaml for that, it's all static in the end anyway
<Algebr`> jekyll is pretty great
<Algebr`> or if wanting to stay in emacs/org-mode then org-page is decent.
<Kakadu> I did some changes for toplevel they kind of work in the `ocaml` but not in the js_of_ocaml toplevel. For example, I don't see dumped source tree after preprocesing. Any ideas what could go wrong?
sbrouf has quit [Ping timeout: 255 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
jeffmo has quit [Quit: jeffmo]
wagle has quit [Remote host closed the connection]
wagle has joined #ocaml
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
wagle has quit [Ping timeout: 240 seconds]
Denommus has quit [Quit: formatting computer]
Major_Biscuit has quit [Quit: WeeChat 1.3]
Haudegen has quit [Ping timeout: 265 seconds]
BitPuffin|osx has joined #ocaml
struk|desk|away is now known as struk|desk
<fds> Drup: Fair enough. I'm not bothered about it being in OCaml, but I thought that since it existed, it was worth asking about.
damason has joined #ocaml
Algebr` has quit [Remote host closed the connection]
ollehar has quit [Quit: ollehar]
Haudegen has joined #ocaml
Algebr has joined #ocaml
palomer has joined #ocaml
wagle has joined #ocaml
<palomer> hey everyone
<fds> Algebr: I'm having a look at org-pages. Thanks for the tip.
<palomer> does anyone know how to run something in x seconds using lwt?
<palomer> (without blocking anything else)
<smondet> palomer: Lwt_unix.sleep x >>= fun () -> something () ?
jeffmo has joined #ocaml
<palomer> join[Lwt_unix.sleep x >>= fun () -> something () ; otherstuff() ] <— like this, but I want them to run alongside each other
<palomer> and if one terminates before the other, I don’t mind
<smondet> palomer: you don't care about their result? then Lwt.async (or Lwt.ignore_result)
<palomer> I guess I should use choose
<smondet> choose is going to cancel the one that does not finish (not always what you want)
jeffmo has quit [Read error: Connection reset by peer]
<palomer> oh no, that’s not what I want
<palomer> I want them both to execute merrily along
sgnb has quit [Ping timeout: 256 seconds]
<palomer> I guess it’s join
jeffmo has joined #ocaml
<palomer> is there anything else apart from join and choose that can help me run things in parallel?
^elyse^ has quit [Quit: Leaving...]
<smondet> Lwt.async, but they all run stuff concurently not necessaryily in "parallel"
sh0t has quit [Quit: Leaving]
<Algebr> palomer: Lwt_list?
ldopa has left #ocaml [#ocaml]