gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
lopex has quit []
lamawithonel has joined #ocaml
Tianon has quit [Remote host closed the connection]
Tianon has joined #ocaml
Tianon has quit [Changing host]
Tianon has joined #ocaml
Tianon has quit [Ping timeout: 240 seconds]
Tianon has joined #ocaml
Tianon has quit [Changing host]
Tianon has joined #ocaml
arubin has joined #ocaml
sebz has joined #ocaml
dnolen has joined #ocaml
joewilliams is now known as joewilliams_away
<thelema> everyonemines: `(x,y as foo)`; and yes. Of course you also have to avoid anything that treats the pair as a single value, such as most higher order functions.
<thelema> jimi_hendrix: match obj_list with [] -> None | hd::tl -> List.fold_left (fun ...) (hd, dist hd) tl
<jimi_hendrix> thelema, alright
<jimi_hendrix> got to get used to those matches :)
<jimi_hendrix> they are pretty cool
ttamttam has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
Julien_T has quit [Ping timeout: 258 seconds]
<thelema> jimi_hendrix: yes, they are
Skolem has quit [Quit: Skolem]
ttamttam has quit [Remote host closed the connection]
arubin has quit [Quit: arubin]
sebz has quit [Quit: Computer has gone to sleep.]
philtor has joined #ocaml
<philtor> Installed ocaml from godi. When I start the toplevel and type: #use "topfind" ;; I don't see the "successfully loaded" message.
clog has quit [Ping timeout: 244 seconds]
clog has joined #ocaml
<thelema> philtor: does `#require "unix";;` work?
<philtor> I'm on Ubuntu. I got rid of /etc/ocamlfind.conf to make sure findlib isn't using that.
<philtor> Not sure... I don't see any message after entering it.
<philtor> #list;; lists things like findlib being present.
<thelema> sounds like findlib is being quiet
<philtor> batteries is listed as well as a bunch of others.
<thelema> then topfind is loaded
<philtor> well, when I try #use "topfind" ;; and then try #camlp4o I don't see anything either.
<thelema> try `Sys.interactive := true`
<thelema> and then something
<philtor> still not reporting anything when I do #use "topfind" ;;
<thelema> `Topfind.announce;;` ?
rwmjones_afk has quit [Ping timeout: 252 seconds]
rwmjones_afk has joined #ocaml
<philtor> Nope.
<philtor> But it does seem to be working.
<philtor> I'm tyring to use bitstring and had to load that and the syntax for it and it does seem to be working.
<philtor> rwmjones_afk : bitstring question.
<philtor> (odd about the non-responsiveness from topfind - On a Suse machine I installed OCaml and I see the "successfully loaded" messages" )
<thelema> btw, batteries has a script that loads itself into the toplevel with some fun addins
bobry has quit [Ping timeout: 255 seconds]
<philtor> Anyone used bitstring?
<philtor> Does batteries do something to stdout?
<philtor> For example, if I try to do:
<philtor> Bitstring.hexdump_bitstring stdout bs ;;
<philtor> I get: # Error: This expression has type unit BatIO.output = unit BatInnerIO.output
<philtor> but an expression was expected of type out_channel
<philtor> (whereas on the other Suse machine I can just specify stdout)
joewilliams_away is now known as joewilliams
<thelema> yes, batteries does replace the usual stdout
<thelema> try Legacy.stdout instead
<thelema> I've used bitstring
sebz has joined #ocaml
bobry has joined #ocaml
<philtor> that's better.
<philtor> thelema: I notice that when using Bitstring.concat that the resulting bitstring doesn't have the right length.
<philtor> This seems especially to be a problem if Bitstring.subbitstring is used to create the bitstrings.
<philtor> So for example, I take one bitstring with length 66 and another with length 67 and the length of the resulting bitstring should be 133 (at least that's what I would expect)
<philtor> ...but I get a bitstring of length 145.
<philtor> Given this bitstring:
<philtor> val bigbs : Bitstring.bitstring =
<philtor> ("ZZZZZZZZZZZZZZZZ]---------------", 0, 256)
<philtor> I take two subbitstrings:
<philtor> # let bb0 = Bitstring.subbitstring bigbs 0 66 ;;
<philtor> val bb0 : Bitstring.bitstring = ("ZZZZZZZZZZZZZZZZ]---------------", 0, 66)
<thelema> Yes, I think there's a known problem in concat
<philtor> Ah, yes seems to be.
<thelema> Bitstring isn't efficient for this kind of operation
<philtor> which kind of operation? concat?
<thelema> are you sure you want to use it for concat
<philtor> Yes, I need to extract some fields from a binary file and then concat them before hexdumping them back out.
<thelema> and the fields are bit-indexed?
<philtor> Basically, there is extraneous data in between some fields which I do not care about and I want to combine the remaining fields which I do care about.
<philtor> so the bitmatch is pretty handy for that, I would think...
<philtor> Yes, the fields looks something like:
<philtor> bitmatch b with { r0 : 1 : bitstring; d0 : 133 : bitstring; r1: 1; d1 : 123 ; ecc : 10 : bitstring } ->
<thelema> eww.
<philtor> Then I want to concat d0 and d1.
<philtor> (ah, d1 should also be type bitstring)
<philtor> ...yeah, well, I'm trying to debug a C program that does this... what a mess.
<philtor> So I was initially trying to use bitstring to generate some data to feed into the c program... but that concat problem prevents it.
<thelema> so it seems. hmm... well, bitstring is a pretty simple data structure - maybe you'll have to write a correct concat and send it in.
<philtor> yes, probably.
<philtor> It seems that part of the problem is that when you get a subbitstring you don't get an entirely new bitstring...
<philtor> at least the data is the same, but the indices are different.
<thelema> that said, the existing implementation probably assumes that the bitstrings to concat are part of the same parent
<thelema> subbitstrings are implemented like that on purpose.
<thelema> you'll have to do the copying if the two bitstrings aren't based on the same string
<thelema> or if they're not adjacent in that string
<philtor> Yes, it seems I need another subbitstring function that creates an entirely new bitstring.
<philtor> I can understand why it is implemented as it is (for efficiency) but in this case it seems not to be working.
<thelema> let concat bs = let buf = Buffer.create () in List.iter (construct_bitstring buf) bs; Buffer.contents buf
<thelema> hmm, it looks like it's designed to work in the case you're trying...
<philtor> That's the current impl.
lamawithonel has quit [Ping timeout: 276 seconds]
<thelema> well, it's not too much code to figure out what's going wrong.
<philtor> true. Just wanted to make sure I wasn't misusing it. but there does seem to be an issue there.
sebz has quit [Quit: Computer has gone to sleep.]
sebz_ has joined #ocaml
brendan has quit [Quit: leaving]
sebz_ has quit [Quit: Computer has gone to sleep.]
lamawithonel has joined #ocaml
lamawithonel has quit [Ping timeout: 255 seconds]
brendan has joined #ocaml
abdallah has quit [Quit: Ex-Chat]
ztfw has quit [Remote host closed the connection]
ulfdoz has joined #ocaml
Reaganomicon has quit [Quit: No Ping reply in 180 seconds.]
Reaganomicon has joined #ocaml
explodus has quit [*.net *.split]
adrien has quit [*.net *.split]
alpounet has quit [*.net *.split]
yroeht has quit [*.net *.split]
patronus_ has quit [*.net *.split]
zzz_ has quit [*.net *.split]
mejalx has quit [*.net *.split]
emias has quit [*.net *.split]
everyonemines has quit [*.net *.split]
hto has quit [*.net *.split]
alxbl has quit [*.net *.split]
The_third_bug has quit [*.net *.split]
hnrgrgr has quit [*.net *.split]
schme has quit [*.net *.split]
rgrinberg has quit [*.net *.split]
flux has quit [*.net *.split]
mbac has quit [*.net *.split]
mundkur_ has quit [*.net *.split]
pheredhel` has quit [*.net *.split]
olasd has quit [*.net *.split]
gildor has quit [*.net *.split]
bobry has quit [*.net *.split]
nimred has quit [*.net *.split]
rferranti has quit [*.net *.split]
ski has quit [*.net *.split]
ousado has quit [*.net *.split]
NaCl has quit [*.net *.split]
rks has quit [*.net *.split]
dsheets has quit [*.net *.split]
othiym23 has quit [*.net *.split]
mal`` has quit [*.net *.split]
krktz has quit [*.net *.split]
ulfdoz has quit [*.net *.split]
lusory has quit [*.net *.split]
ccasin has quit [*.net *.split]
Obfuscate has quit [*.net *.split]
Qrntzz has quit [*.net *.split]
Derander has quit [*.net *.split]
chee1 has quit [*.net *.split]
willb has quit [*.net *.split]
Reaganomicon has quit [*.net *.split]
Amorphous has quit [*.net *.split]
junsuijin has quit [*.net *.split]
mehdid has quit [*.net *.split]
jimi_hendrix has quit [*.net *.split]
mfp has quit [*.net *.split]
hyperboreean has quit [*.net *.split]
redsteg has quit [*.net *.split]
_habnabit has quit [*.net *.split]
rixed has quit [*.net *.split]
orbitz has quit [*.net *.split]
ttblrs has quit [*.net *.split]
mcclurmc has quit [*.net *.split]
thelema has quit [*.net *.split]
wtetzner has quit [*.net *.split]
joewilliams has quit [*.net *.split]
asmanur has quit [*.net *.split]
hcarty has quit [*.net *.split]
corecode has quit [*.net *.split]
wormphlegm has quit [*.net *.split]
bitbckt has quit [*.net *.split]
dcolish has quit [*.net *.split]
chambart has quit [*.net *.split]
sgnb has quit [*.net *.split]
noj has quit [*.net *.split]
fabjan has quit [*.net *.split]
Tobu has quit [*.net *.split]
jlouis has quit [*.net *.split]
rossberg has quit [*.net *.split]
philtor has quit [*.net *.split]
dnolen has quit [*.net *.split]
fraggle_ has quit [*.net *.split]
shachaf has quit [*.net *.split]
jonafan has quit [*.net *.split]
mattam has quit [*.net *.split]
snarkyboojum has quit [*.net *.split]
Tianon has quit [*.net *.split]
struktured has quit [*.net *.split]
zorun has quit [*.net *.split]
f[x] has quit [*.net *.split]
foocraft has quit [*.net *.split]
wishi has quit [*.net *.split]
wagle has quit [*.net *.split]
raphael-p has quit [*.net *.split]
Asmadeus has quit [*.net *.split]
Pepe_ has quit [*.net *.split]
malouin has quit [*.net *.split]
rby has quit [*.net *.split]
haelix has quit [*.net *.split]
ankit9 has quit [*.net *.split]
bacam has quit [*.net *.split]
TaXules has quit [*.net *.split]
zmoazeni has quit [*.net *.split]
rwmjones_afk has quit [*.net *.split]
milosn has quit [*.net *.split]
caligula has quit [*.net *.split]
diml has quit [*.net *.split]
svenl has quit [*.net *.split]
Reaganomicon has joined #ocaml
ulfdoz has joined #ocaml
bobry has joined #ocaml
rwmjones_afk has joined #ocaml
philtor has joined #ocaml
dnolen has joined #ocaml
Tianon has joined #ocaml
struktured has joined #ocaml
schme has joined #ocaml
Amorphous has joined #ocaml
rgrinberg has joined #ocaml
junsuijin has joined #ocaml
everyonemines has joined #ocaml
zorun has joined #ocaml
ankit9 has joined #ocaml
hto has joined #ocaml
wormphlegm has joined #ocaml
mehdid has joined #ocaml
f[x] has joined #ocaml
alxbl has joined #ocaml
explodus has joined #ocaml
jimi_hendrix has joined #ocaml
nimred has joined #ocaml
milosn has joined #ocaml
lusory has joined #ocaml
fraggle_ has joined #ocaml
redsteg has joined #ocaml
mfp has joined #ocaml
rks has joined #ocaml
rferranti has joined #ocaml
hyperboreean has joined #ocaml
foocraft has joined #ocaml
flux has joined #ocaml
bitbckt has joined #ocaml
asmanur has joined #ocaml
willb has joined #ocaml
krktz has joined #ocaml
mal`` has joined #ocaml
chee1 has joined #ocaml
Derander has joined #ocaml
Qrntzz has joined #ocaml
othiym23 has joined #ocaml
Obfuscate has joined #ocaml
ccasin has joined #ocaml
dsheets has joined #ocaml
NaCl has joined #ocaml
ousado has joined #ocaml
ski has joined #ocaml
ttblrs has joined #ocaml
mcclurmc has joined #ocaml
thelema has joined #ocaml
wtetzner has joined #ocaml
joewilliams has joined #ocaml
orbitz has joined #ocaml
corecode has joined #ocaml
emias has joined #ocaml
mejalx has joined #ocaml
zzz_ has joined #ocaml
patronus_ has joined #ocaml
yroeht has joined #ocaml
alpounet has joined #ocaml
adrien has joined #ocaml
The_third_bug has joined #ocaml
mundkur_ has joined #ocaml
pheredhel` has joined #ocaml
hnrgrgr has joined #ocaml
gildor has joined #ocaml
olasd has joined #ocaml
rixed has joined #ocaml
hcarty has joined #ocaml
mbac has joined #ocaml
_habnabit has joined #ocaml
dcolish has joined #ocaml
chambart has joined #ocaml
sgnb has joined #ocaml
wishi has joined #ocaml
shachaf has joined #ocaml
wagle has joined #ocaml
rossberg has joined #ocaml
jlouis has joined #ocaml
Tobu has joined #ocaml
fabjan has joined #ocaml
noj has joined #ocaml
jonafan has joined #ocaml
caligula has joined #ocaml
mattam has joined #ocaml
snarkyboojum has joined #ocaml
zmoazeni has joined #ocaml
bacam has joined #ocaml
TaXules has joined #ocaml
haelix has joined #ocaml
rby has joined #ocaml
malouin has joined #ocaml
Pepe_ has joined #ocaml
Asmadeus has joined #ocaml
raphael-p has joined #ocaml
svenl has joined #ocaml
diml has joined #ocaml
ikaros has joined #ocaml
bitbckt has quit [Ping timeout: 244 seconds]
bitbckt has joined #ocaml
joewilliams is now known as joewilliams_away
sebz has joined #ocaml
sebz_ has joined #ocaml
sebz_ has quit [Client Quit]
sebz has quit [Ping timeout: 245 seconds]
ulfdoz has quit [Ping timeout: 258 seconds]
ikaros has quit [Remote host closed the connection]
testcocoon has joined #ocaml
philtor has quit [Ping timeout: 276 seconds]
larhat has joined #ocaml
<rgrinberg> how do you do a 1..n sequence in batteries again
<_habnabit> 1 -- n
<_habnabit> that's a closed range, though. 1 --^ n for a half-open range.
<rgrinberg> ugh, can i see an example, saying mapping a sequnce of 1.. n to 2..n+1
<_habnabit> 1 -- n |> List.map ((+) 1)
<_habnabit> errrr.
<_habnabit> Enum.map
<rgrinberg> thanks, for some reason i thought the syntax had tildas and stuff
<_habnabit> --~ is for char ranges
<rgrinberg> ahh ok
everyonemines has quit [Quit: Leaving.]
ttamttam has joined #ocaml
lopex has joined #ocaml
ankit9 has quit [Quit: Leaving]
edwin has joined #ocaml
dnolen has quit [Quit: dnolen]
Cyanure has joined #ocaml
sebz has joined #ocaml
mnabil has joined #ocaml
rwmjones_afk is now known as rwmjones
ankit9 has joined #ocaml
everyonemines has joined #ocaml
Julien_T has joined #ocaml
joewilliams_away has quit [Quit: ZNC - http://znc.sourceforge.net]
joewilliams_away has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
bitbckt has quit [Quit: out]
sebz has joined #ocaml
bitbckt has joined #ocaml
everyonemines has quit [Quit: Leaving.]
sebz has quit [Quit: Computer has gone to sleep.]
thomasga has joined #ocaml
Julien_T has quit [Ping timeout: 248 seconds]
sebz has joined #ocaml
asmanur has quit [Ping timeout: 252 seconds]
asmanur has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
Julien_T has joined #ocaml
Julien_T has quit [Ping timeout: 260 seconds]
sebz_ has joined #ocaml
surikator has joined #ocaml
ttamttam has quit [Ping timeout: 252 seconds]
surikator has quit [Read error: Operation timed out]
surikator has joined #ocaml
ttamttam has joined #ocaml
bitbckt has quit [Quit: out]
bitbckt has joined #ocaml
lamawithonel has joined #ocaml
nordoff has joined #ocaml
bitbckt has quit [Quit: out]
bitbckt has joined #ocaml
lamawithonel has quit [Read error: Connection reset by peer]
chp has joined #ocaml
chp has quit [Client Quit]
ttamttam has quit [Remote host closed the connection]
phc has joined #ocaml
phc has quit [Client Quit]
chp has joined #ocaml
_andre has joined #ocaml
lamawithonel has joined #ocaml
chp has quit [Quit: Ex-Chat]
ttamttam has joined #ocaml
rby has quit [Quit: Lost terminal]
ttamttam has quit [Remote host closed the connection]
surikator has quit [Quit: Computer is sleeping. I'm probably not.]
ttamttam has joined #ocaml
surikator has joined #ocaml
mnabil has quit [Read error: Operation timed out]
sebz_ has quit [Quit: Computer has gone to sleep.]
ikaros has joined #ocaml
sebz has joined #ocaml
surikator has quit [Quit: Scientific discovery is just maximal compression of strings. Nothing more, nothing less.]
ttamttam has quit [Quit: ttamttam]
ttamttam has joined #ocaml
ttamttam has quit [Ping timeout: 255 seconds]
ttamttam has joined #ocaml
mnabil has joined #ocaml
Cyanure has quit [Remote host closed the connection]
lamawithonel has quit [Ping timeout: 248 seconds]
lamawithonel has joined #ocaml
Kakadu has joined #ocaml
Julien_T has joined #ocaml
ttamttam has quit [Remote host closed the connection]
ttamttam has joined #ocaml
rby has joined #ocaml
Julien_T has quit [Ping timeout: 258 seconds]
nordoff has quit [Quit: Page closed]
benus has joined #ocaml
ttamttam has left #ocaml []
ttamttam has joined #ocaml
ttamttam has quit [Client Quit]
lopex_ has joined #ocaml
lopex has quit [Ping timeout: 252 seconds]
ttamttam has joined #ocaml
ttamttam has quit [Client Quit]
benus has quit [Remote host closed the connection]
Kakadu has quit [Ping timeout: 252 seconds]
ttamttam has joined #ocaml
ttamttam has left #ocaml []
rossberg has quit [Ping timeout: 244 seconds]
rossberg has joined #ocaml
Kakadu has joined #ocaml
ttamttam has joined #ocaml
ttamttam has quit [Remote host closed the connection]
ttamttam has joined #ocaml
ankit9 has quit [Quit: Leaving]
surikator has joined #ocaml
fraggle_ has quit [Quit: -ENOBRAIN]
<thelema> 10 points to anyone who can figure out what's gone wrong in this stream code: http://pastebin.com/gubMCSrP
ygrek has joined #ocaml
philtor has joined #ocaml
<f[x]> the author used undocumented functions - where can I claim my 10 points? :)
deavid has quit [Ping timeout: 256 seconds]
explodus has quit [*.net *.split]
adrien has quit [*.net *.split]
alpounet has quit [*.net *.split]
yroeht has quit [*.net *.split]
patronus_ has quit [*.net *.split]
zzz_ has quit [*.net *.split]
mejalx has quit [*.net *.split]
emias has quit [*.net *.split]
hto has quit [*.net *.split]
alxbl has quit [*.net *.split]
The_third_bug has quit [*.net *.split]
hnrgrgr has quit [*.net *.split]
rby has quit [*.net *.split]
sebz has quit [*.net *.split]
schme has quit [*.net *.split]
rgrinberg has quit [*.net *.split]
flux has quit [*.net *.split]
mbac has quit [*.net *.split]
mundkur_ has quit [*.net *.split]
pheredhel` has quit [*.net *.split]
olasd has quit [*.net *.split]
gildor has quit [*.net *.split]
bobry has quit [*.net *.split]
nimred has quit [*.net *.split]
rferranti has quit [*.net *.split]
ski has quit [*.net *.split]
ousado has quit [*.net *.split]
NaCl has quit [*.net *.split]
Kakadu has quit [*.net *.split]
lopex_ has quit [*.net *.split]
thomasga has quit [*.net *.split]
rks has quit [*.net *.split]
dsheets has quit [*.net *.split]
othiym23 has quit [*.net *.split]
mal`` has quit [*.net *.split]
krktz has quit [*.net *.split]
lamawithonel has quit [*.net *.split]
testcocoon has quit [*.net *.split]
lusory has quit [*.net *.split]
ccasin has quit [*.net *.split]
Obfuscate has quit [*.net *.split]
Qrntzz has quit [*.net *.split]
Derander has quit [*.net *.split]
chee1 has quit [*.net *.split]
willb has quit [*.net *.split]
ygrek has quit [*.net *.split]
Reaganomicon has quit [*.net *.split]
Amorphous has quit [*.net *.split]
junsuijin has quit [*.net *.split]
mehdid has quit [*.net *.split]
jimi_hendrix has quit [*.net *.split]
mfp has quit [*.net *.split]
hyperboreean has quit [*.net *.split]
redsteg has quit [*.net *.split]
_habnabit has quit [*.net *.split]
rixed has quit [*.net *.split]
orbitz has quit [*.net *.split]
ttblrs has quit [*.net *.split]
mcclurmc has quit [*.net *.split]
thelema has quit [*.net *.split]
wtetzner has quit [*.net *.split]
asmanur has quit [*.net *.split]
joewilliams_away has quit [*.net *.split]
hcarty has quit [*.net *.split]
corecode has quit [*.net *.split]
surikator has quit [*.net *.split]
bitbckt has quit [*.net *.split]
wormphlegm has quit [*.net *.split]
dcolish has quit [*.net *.split]
chambart has quit [*.net *.split]
sgnb has quit [*.net *.split]
noj has quit [*.net *.split]
fabjan has quit [*.net *.split]
Tobu has quit [*.net *.split]
jlouis has quit [*.net *.split]
ttamttam has quit [*.net *.split]
edwin has quit [*.net *.split]
larhat has quit [*.net *.split]
shachaf has quit [*.net *.split]
jonafan has quit [*.net *.split]
mattam has quit [*.net *.split]
snarkyboojum has quit [*.net *.split]
rossberg has quit [*.net *.split]
Tianon has quit [*.net *.split]
struktured has quit [*.net *.split]
zorun has quit [*.net *.split]
f[x] has quit [*.net *.split]
foocraft has quit [*.net *.split]
wishi has quit [*.net *.split]
wagle has quit [*.net *.split]
raphael-p has quit [*.net *.split]
Asmadeus has quit [*.net *.split]
Pepe_ has quit [*.net *.split]
malouin has quit [*.net *.split]
haelix has quit [*.net *.split]
bacam has quit [*.net *.split]
TaXules has quit [*.net *.split]
philtor has quit [*.net *.split]
ikaros has quit [*.net *.split]
zmoazeni has quit [*.net *.split]
rwmjones has quit [*.net *.split]
milosn has quit [*.net *.split]
caligula has quit [*.net *.split]
diml has quit [*.net *.split]
svenl has quit [*.net *.split]
deavid has joined #ocaml
philtor has joined #ocaml
surikator has joined #ocaml
ttamttam has joined #ocaml
Kakadu has joined #ocaml
rossberg has joined #ocaml
lopex_ has joined #ocaml
rby has joined #ocaml
lamawithonel has joined #ocaml
sebz has joined #ocaml
ikaros has joined #ocaml
bitbckt has joined #ocaml
asmanur has joined #ocaml
thomasga has joined #ocaml
joewilliams_away has joined #ocaml
edwin has joined #ocaml
larhat has joined #ocaml
testcocoon has joined #ocaml
Reaganomicon has joined #ocaml
bobry has joined #ocaml
rwmjones has joined #ocaml
Tianon has joined #ocaml
struktured has joined #ocaml
schme has joined #ocaml
Amorphous has joined #ocaml
rgrinberg has joined #ocaml
junsuijin has joined #ocaml
zorun has joined #ocaml
hto has joined #ocaml
wormphlegm has joined #ocaml
mehdid has joined #ocaml
f[x] has joined #ocaml
alxbl has joined #ocaml
explodus has joined #ocaml
jimi_hendrix has joined #ocaml
nimred has joined #ocaml
milosn has joined #ocaml
lusory has joined #ocaml
redsteg has joined #ocaml
mfp has joined #ocaml
rks has joined #ocaml
rferranti has joined #ocaml
hyperboreean has joined #ocaml
foocraft has joined #ocaml
flux has joined #ocaml
diml has joined #ocaml
svenl has joined #ocaml
raphael-p has joined #ocaml
Asmadeus has joined #ocaml
Pepe_ has joined #ocaml
malouin has joined #ocaml
haelix has joined #ocaml
TaXules has joined #ocaml
bacam has joined #ocaml
zmoazeni has joined #ocaml
snarkyboojum has joined #ocaml
mattam has joined #ocaml
caligula has joined #ocaml
jonafan has joined #ocaml
noj has joined #ocaml
fabjan has joined #ocaml
Tobu has joined #ocaml
jlouis has joined #ocaml
wagle has joined #ocaml
shachaf has joined #ocaml
wishi has joined #ocaml
sgnb has joined #ocaml
chambart has joined #ocaml
dcolish has joined #ocaml
_habnabit has joined #ocaml
mbac has joined #ocaml
hcarty has joined #ocaml
rixed has joined #ocaml
willb has joined #ocaml
krktz has joined #ocaml
mal`` has joined #ocaml
chee1 has joined #ocaml
Derander has joined #ocaml
Qrntzz has joined #ocaml
othiym23 has joined #ocaml
Obfuscate has joined #ocaml
ccasin has joined #ocaml
dsheets has joined #ocaml
NaCl has joined #ocaml
ousado has joined #ocaml
ski has joined #ocaml
ttblrs has joined #ocaml
mcclurmc has joined #ocaml
thelema has joined #ocaml
wtetzner has joined #ocaml
orbitz has joined #ocaml
corecode has joined #ocaml
emias has joined #ocaml
mejalx has joined #ocaml
zzz_ has joined #ocaml
patronus_ has joined #ocaml
yroeht has joined #ocaml
alpounet has joined #ocaml
adrien has joined #ocaml
The_third_bug has joined #ocaml
mundkur_ has joined #ocaml
pheredhel` has joined #ocaml
hnrgrgr has joined #ocaml
gildor has joined #ocaml
olasd has joined #ocaml
<f[x]> not that it was (max_int + 1)
<raphael-p> Ok, so what's the difference between 'A of int * int' and 'A of (int * int)'?
<thelema> f[x]: :)
<raphael-p> the former doesn't accept let t = (0,1) in A t
<raphael-p> while the latter does
<thelema> raphael-p: the internal representation and the difference you note
<raphael-p> anyone know why?
ygrek has joined #ocaml
<raphael-p> is there a reason why I should use the former?
<thelema> yes, the former is implemented as a length 3 record, holding the tag for A and two ints
<thelema> the second is a length two record, holding the tag for A and a pointer to a pair
<raphael-p> so there's an additional pointer in the latter
<thelema> the former can save memory indirection cost if you don't need access to the pair as a single unit
<thelema> exactly
<thelema> that pointer gives you the ability to push a pair in directly
<raphael-p> I choose code clarity over speed (for this particular thing that I'm doing and that doesn't require speed)
<raphael-p> thank you thelema
<thelema> n/p
<raphael-p> incr thelema
<thelema> luckily, I'm on a 64-bit system, so no danger of overflow
<adrien> sometimes, when I can make code much faster but also less readable, I put the readable version in comment before the faster version
<raphael-p> (anyone want to code a bot that records incrs and decrs and print scores on demand?)
sebz has quit [Quit: Computer has gone to sleep.]
<raphael-p> and after :%s/\(\s\+of\s\+\)\(.*\)$/\1(\2)/ everything looks shiny
<adrien> hmm, I have code for finding positions on the hilbert curve; it's hard to guess
oriba has joined #ocaml
ygrek has quit [Ping timeout: 248 seconds]
philtor has quit [Read error: Operation timed out]
Kakadu has quit [Quit: Page closed]
surikator has quit [Quit: Scientific discovery is just maximal compression of strings. Nothing more, nothing less.]
thomasga has quit [Quit: Leaving.]
clog has quit [^C]
clog has joined #ocaml
lopex has joined #ocaml
abdallah has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
mnabil has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
sebz has joined #ocaml
oriba has quit [Quit: oriba]
sebz has quit [Quit: Computer has gone to sleep.]
Cyanure has joined #ocaml
Guest10259 is now known as brendan
sebz has joined #ocaml
sebz has quit [Client Quit]
fraggle_ has joined #ocaml
<abdallah> Why doesn't the Set module in the standard library provide a polymorphic implementation?
<thelema> abdallah: because it doesn't. Batteries does.
<abdallah> :-)
<abdallah> Is there any persisting reason why Hashtbl and Set are treated differently in the std library? Or is it just legacy?
edwin has quit [Remote host closed the connection]
<adrien> differently? you mean Set using functors and not Hashtbl?
<thelema> just legacy. I'm guessing they needed a polymorphic hashtable to build ocamlc, but didn't need a polymorphic set and map, so just built nice functorial ones
<abdallah> I see thanks.
<abdallah> I need to build sets of 'a t with my own comparator (independant of 'a), what is the best way to go?
<abdallah> I cannot use the functorial set because 'a is unbound and I cannot use directly a polymorphic set because I do not want to use Pervasive.compare.
<thelema> abdallah: 1) implement your sets on top of hashtbl or 2) depend on batteries or 3) copy batteries' polymorphic set implementation
<thelema> (batteries' polymorphic sets still allows custom compare functions)
<abdallah> Ah ok, that's good !
<abdallah> I had my own polymorphic set but it did not allow custom compare functions.
<abdallah> What is the licensing effect of copying one of batteries' file and using it in my project?
Julien_T has joined #ocaml
<thelema> LGPL - if you modify the batteries set, you have to release the modifications
ulfdoz has joined #ocaml
edwin has joined #ocaml
Julien_T has quit [Ping timeout: 255 seconds]
_andre_ is now known as _andre
emmanuelux has joined #ocaml
larhat has quit [Quit: Leaving.]
edwin has quit [Remote host closed the connection]
Boscop has joined #ocaml
<abdallah> thelema: ok. If I include and use it without modification, am I allowed to release a single executable, or should I release the executable as well as the source of the LGPL files (which are otherwise available on batteries project site)?
<thelema> if you include and use it w/o modification, you can release just an executable
<abdallah> ok
<thelema> It probably won't hurt to say that you used batteries for some stuff and point to our web site, I'm not certain whether that's required
<abdallah> I see.
<thelema> yes, it looks like attribution is required if you use substantial parts of the code: http://stackoverflow.com/questions/1857659/open-source-licenses-lgpl-vs-creative-commons/1857676#1857676
<abdallah> If I make any modification and send them upstream, do I need to provide source with my exectuables? Does it depend on whether my patch is accepted?
<thelema> you can put a link to the modified source as part of the attribution
<thelema> We're pretty liberal about accepting patches
<abdallah> What if I wish to release my whole project under BSD licence? I suppose I'll have to mark the batteries' files as external library so that it does not interfere?!
<thelema> If you just want to use Set, poke bluestorm - he re-wrote the current version in ite entirety, he can give you a more permissive license
<thelema> abdallah: and as much as I appreciate you worrying about licensing, just take the batteries files wholesale, and keep their headers, and I don't think there'll be any problems
<abdallah> Ok perfect, thanks!
Boscop_ has joined #ocaml
<thelema> especially if you point to your repo in the docs that come with the binary
<_habnabit> everyone should just be using BSD
<_habnabit> (the OS and the license)
<thelema> _habnabit: which BSD?
<_habnabit> yes!
<thelema> and which license? 2-clause? 3-clause? other variant?
<_habnabit> it was mostly a joke, though I do use 2-clause BSD for my personal projects
Julien_T has joined #ocaml
Boscop has quit [Ping timeout: 260 seconds]
<mfp> abdallah: you can also build polymorphic sets atop the functional ones by using 1st class modules
<thelema> mfp: isn't scope a problem for that?
<abdallah> mfp: Ok, sounds interesting. Unfortunately I have to stick with 3.11 as my project doesn't build with 3.12.
<mfp> AFAIK it works; in fact, I might have it done before :P
<thelema> mfp: okay then.
<mfp> thelema: you basically carry a value of type (module Set.S with type elt = 'a)
<thelema> ah, that could make it work
<mfp> and then each op is implemented by unpacking the 1st class module
<thelema> if you put that into your map value
edwin has joined #ocaml
<mfp> right
<mfp> in fact you might need to wrap the set itself in the module, as in (module (sig include Set.S val s : t end with type elt = 'a))
<mfp> then let make (type a) cmp = (struct include Set.Make(struct type elt = a let compare = cmp) let s = empty end : sig include Set.S val s : t end with type elt = 'a))
<mfp> or so modulo typos and stuff (you'd define an aux. module type for that too)
<thelema> eww
<thelema> ugly hackery
<mfp> and e.g. let add (type a) (x : a) s = let module S : S' with type elt = a in (module struct include S let s = add x s end : S' with type elt = a)
<mfp> you have to unpack and repack on each op, which is far from elegant
bobry has quit [Remote host closed the connection]
bobry has joined #ocaml
Boscop has joined #ocaml
<mfp> you can omit most type annotations in 3.13, however
Boscop_ has quit [Ping timeout: 244 seconds]
Anarchos has joined #ocaml
edwin has quit [Remote host closed the connection]
tlockney_ is now known as tlockney
lpereira has joined #ocaml
edwin has joined #ocaml
Julien_T has quit [Ping timeout: 245 seconds]
ttamttam has quit [Remote host closed the connection]
Boscop_ has joined #ocaml
Boscop has quit [Ping timeout: 276 seconds]
Boscop has joined #ocaml
Boscop_ has quit [Ping timeout: 252 seconds]
Boscop_ has joined #ocaml
ankit9 has joined #ocaml
ygrek has joined #ocaml
Boscop has quit [Ping timeout: 244 seconds]
Boscop has joined #ocaml
Boscop_ has quit [Ping timeout: 244 seconds]
fschwidom has joined #ocaml
ygrek has quit [Quit: Leaving]
Boscop has quit [Ping timeout: 260 seconds]
ygrek has joined #ocaml
Kakadu has quit [Quit: Konversation terminated!]
_andre has quit [Quit: leaving]
fschwidom has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 248 seconds]
ygrek has joined #ocaml
everyonemines has joined #ocaml
ulfdoz has quit [Ping timeout: 256 seconds]
edwin has quit [Quit: Leaving.]
edwin has joined #ocaml
Cyanure has quit [Ping timeout: 258 seconds]
oriba has joined #ocaml
Cyanure has joined #ocaml
liteblackk has joined #ocaml
liteblackk has quit [Quit: Ухожу я от вас]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
edwin has quit [Remote host closed the connection]
<malouin> any recommendations on how to manage ocaml libraries on OS X? godi? macports? homebrew?
rferranti has left #ocaml []
<_habnabit> malouin, I do godi + oasis
<_habnabit> macports is bad, and homebrew has the (generally correct) philosophy of declaring that language-specific packages are Someone Else's Problem
<malouin> ok.
<malouin> it sounds like I should not try to do ocaml through macports at all.
<malouin> at least, it has been breaking for me a lot.
<_habnabit> you should not use macports at all.
<malouin> which I don't mind too much, but it is driving my advisor nuts.
<malouin> _habnabit: because homebrew is the future?
<_habnabit> well, mostly because macports is terrible.
<malouin> I haven't had the best experience so far.
ikaros has quit [Quit: Ex-Chat]
lpereira has quit [Quit: Leaving.]
Cyanure has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 248 seconds]
flapjackery has joined #ocaml
flapjackery has quit [Client Quit]
Amorphous has quit [Ping timeout: 248 seconds]
<abdallah> How am I suppose to profile my code if I make intensive use of higher order functions?
Amorphous has joined #ocaml
lopex has quit []
dgbaley27 has joined #ocaml
<dgbaley27> Sorry if I'm using the wrong terminology. Is there any way to get the components of a type without match? Like if I have "type foo = int * bool" and a foo is passed to a function, can I get at each "member" without matching the function argument?
<_habnabit> dgbaley27, `let f ((x, y): foo) = if y then x else ~-x`
<_habnabit> actually, I remembered the other syntax for signatures
<_habnabit> let f: foo -> int = fun (x, y) -> if y then x else ~-x
<dgbaley27> Lets say I the type contains 50 elements, and it's generally convenient for me to treat the argument as the type as a whole, but for one small thing, I just need one of the elements.
<_habnabit> okay, 'type' is the wrong word here. you're talking about tuples.
<dgbaley27> ok
<_habnabit> and if you have >2 elements, you more than likely want a record type instead of a tuple.
<_habnabit> since x.f50 is easier than `let _, _, _, _, [...], _, y = x`
<dgbaley27> I have, for example, "type lambda = var * exp". And it's generally more convenient to treat the lambda as a single variable, but sometimes I need to get at just the "var" part. I find it cumbersome to have to then match the lambda to break it up
<dgbaley27> Ok, I will look up record types
<_habnabit> again, you don't need to match
<_habnabit> you can do it as part of defining the function, or `let _, y = x`
<dgbaley27> Yeah but then I lose the ability to also treat it as a single thing
<_habnabit> no?
<_habnabit> in that example, you have both x and y
<_habnabit> also, `let f (_, y as x) = ...`
<dgbaley27> let f (a: mytype) and let f ((x,y): mytype)... I can either have "a" or "x,y" but I'm not seeing how I can have both
<_habnabit> then read what I just said
<dgbaley27> x gives me the sequence and y gives me just the second element?
<_habnabit> x is the tuple, yes.