gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
sepp2k has joined #ocaml
mjonsson has joined #ocaml
carm has joined #ocaml
sepp2k has quit [Quit: Leaving.]
mlh_ has left #ocaml []
aj2009 has joined #ocaml
pheredhel has quit [Ping timeout: 240 seconds]
rudi_s has quit [Ping timeout: 240 seconds]
rudi_s has joined #ocaml
ccasin has quit [Quit: Leaving]
pheredhel has joined #ocaml
olauzon has quit [Quit: olauzon]
Edward has quit []
_unK has quit [Remote host closed the connection]
pheredhel has quit [Ping timeout: 240 seconds]
pheredhel has joined #ocaml
aj2009 has quit [Remote host closed the connection]
aj2009 has joined #ocaml
boscop has quit [Ping timeout: 252 seconds]
aj2009 has quit [Quit: Leaving]
boscop has joined #ocaml
joewilliams is now known as joewilliams_away
valross has joined #ocaml
valross has quit [Read error: Operation timed out]
iago has quit [Quit: Leaving]
valross has joined #ocaml
mawhidby has joined #ocaml
jakedouglas has quit [Quit: Leaving.]
mawhidby has quit [Client Quit]
tsuhao has joined #ocaml
<tsuhao> hi all, I'm new to OCaml, is there someone who can help me debug a basic function?
xeno has quit [Ping timeout: 258 seconds]
tsuhao has quit [Quit: tsuhao]
wormphlegm has joined #ocaml
wormphlegm has quit [Client Quit]
wormphlegm has joined #ocaml
joewilliams_away is now known as joewilliams
joewilliams is now known as joewilliams_away
wormphlegm has quit [Quit: hmm]
mjonsson has quit [Remote host closed the connection]
schme has joined #ocaml
schme has quit [Changing host]
schme has joined #ocaml
schme is now known as schmrkc
palomer has joined #ocaml
jakedouglas has joined #ocaml
ulfdoz has joined #ocaml
jakedouglas has quit [Quit: Leaving.]
mlh has joined #ocaml
valross has quit [Ping timeout: 276 seconds]
<flux> hmm, this is a fun idea, I guess it could be applied to ocaml as well? http://wingolog.org/archives/2010/09/07/abusing-the-c-compiler
ulfdoz has quit [Ping timeout: 246 seconds]
valross has joined #ocaml
valross has quit [Ping timeout: 252 seconds]
ygrek has joined #ocaml
ikaros has joined #ocaml
valross has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
ygrek has joined #ocaml
aja has joined #ocaml
<palomer> whoa
<palomer> I'm getting the strangest segfault ever
<palomer> let may f = function None -> () | Some x -> f x in may (fun _ -> ()) foo <--this segfaults
<palomer> if I do the match by hand it doesn't
<adrien> works here, think it could be something else?
<palomer> I sandwiched it in print_endlines
<palomer> i mean, it _should_ work
<palomer> if I remove it the following print_endline prints
<sgnb> palomer: what is foo?
<adrien> flux: I've actually done something similar I think: write C code in ocaml, save it, compile it as a shared object, dlopen/sym it, call it from ocaml and get the results
<adrien> really slow however
<adrien> flux: but my thing was at run-time, not compile-time
Yoric has joined #ocaml
<palomer> foo is an option
<palomer> an ocaml type option
<palomer> hey Yoric
<sgnb> but for which value of foo it segfaults?
<sgnb> (I tried None, Some 1 and it doesn't here)
<palomer> the code is never supposed to segfault...if it segfaults then that value probably isn't an option
xeno has joined #ocaml
<Yoric> hi
<Yoric> palomer: how do you do?
<sgnb> palomer: sure... but I am trying to reproduce your bug, and your report is incomplete
roconnor has quit [Remote host closed the connection]
<palomer> sgnb: well, erm, I can give you the complete source if you like
<sgnb> palomer: cannot you give just the value of foo that segfaults?
<palomer> I wish I had it
<palomer> you have a point though...
<palomer> I should trace it to the source
<adrien> also, you can run the program under gdb, it can give some info
<palomer> I'm running it through ocamlrun
<sgnb> palomer: it segfaults both on native and bytecode?
<f[x]> palomer, any C bindings used?
<palomer> sgnb: well...it's a hacked ocaml compiler
<sgnb> of course, the first thing to do is to remove all C / Obj module / etc...
<palomer> bytecode only
<palomer> f[x]: I wish I knew
<sgnb> (regular ocaml compiler...)
<sgnb> which hacked version?
<palomer> my own
<f[x]> if you are using "hacked" compiler then you should have some clue of what you are doing
<sgnb> but what is hacked in it?
<palomer> just some little additions
<palomer> want to get the hang of this thing
<adrien> sgnb: the syntax on your link (C++ lambdas) make my head hurt ;-)
<sgnb> palomer: you are not really helping: "it's in a big program, using my own hacked compiler, with some little additions"... I don't know how you expect people to help
<palomer> hrmph, you're right
<palomer> not much you can do:/
<palomer> thanks anyways though
ygrek has quit [Ping timeout: 245 seconds]
_unK has joined #ocaml
JimmyRcom has quit [Ping timeout: 258 seconds]
Amorphous has quit [Read error: Operation timed out]
ftrvxmtrx has quit [Quit: Leaving]
<palomer> how is boot/ocamlc built?
<palomer> actually, that probably involves a lengthy answer
* palomer runs away!
palomer has quit [Quit: palomer]
<adrien> (make bootstrap?)
Amorphous has joined #ocaml
Yoric has quit [Quit: Yoric]
ikaros has quit [Quit: Leave the magic to Houdini]
ftrvxmtrx has joined #ocaml
ygrek has joined #ocaml
rprichard has joined #ocaml
det has quit [Ping timeout: 240 seconds]
th5 has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
det has joined #ocaml
avsm has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
sepp2k has joined #ocaml
ftrvxmtrx has joined #ocaml
Yoric has joined #ocaml
schmrkc has quit [Ping timeout: 260 seconds]
schmrkc has joined #ocaml
schmrkc has quit [Changing host]
schmrkc has joined #ocaml
sepp2k has quit [Ping timeout: 252 seconds]
sepp2k has joined #ocaml
carm has quit [Ping timeout: 252 seconds]
rprichard has quit [Remote host closed the connection]
ttamttam has joined #ocaml
carm has joined #ocaml
carm has quit [Read error: Connection reset by peer]
ccasin has joined #ocaml
JimmyRcom has joined #ocaml
Smerdyakov has joined #ocaml
Smerdyakov has quit [Client Quit]
kaustuv has joined #ocaml
mjonsson has joined #ocaml
aja has quit [Read error: Connection reset by peer]
olauzon has joined #ocaml
sepp2k has quit [Quit: Leaving.]
valross has quit [Quit: Ex-Chat]
mjonsson has quit [Ping timeout: 276 seconds]
joewilliams_away is now known as joewilliams
jakedouglas has joined #ocaml
ftrvxmtrx has quit [Read error: Connection reset by peer]
th5 has quit [Quit: th5]
ftrvxmtrx has joined #ocaml
joewilliams is now known as joewilliams_away
mcclurmc has quit [Quit: Leaving]
ttamttam has quit [Remote host closed the connection]
drksd` has joined #ocaml
joewilliams_away is now known as joewilliams
drksd has left #ocaml []
rks has joined #ocaml
oriba has joined #ocaml
drksd` has quit [Quit: foo]
olauzon has quit [Quit: olauzon]
joewilliams is now known as joewilliams_away
joewilliams_away has quit [Quit: ZNC - http://znc.sourceforge.net]
ikaros has joined #ocaml
joewilliams has joined #ocaml
Yoric has quit [Quit: Yoric]
ikaros_ has joined #ocaml
ikaros has quit [Ping timeout: 265 seconds]
ftrvxmtrx has quit [Quit: Leaving]
robthebob has joined #ocaml
init1 has joined #ocaml
ygrek has joined #ocaml
ulfdoz has joined #ocaml
ygrek has quit [Remote host closed the connection]
Thorn has quit [Ping timeout: 240 seconds]
sepp2k has joined #ocaml
thelema_ has joined #ocaml
<robthebob> hi thelema
<robthebob> seeing some very strange behaviour in Batteries 1.2.X with BatMap
<robthebob> please see http://pastebin.com/jBC1XXuE
hyperbor1ean has joined #ocaml
<robthebob> If you save as TestIntegerMap.ml, and compile:
<robthebob> ocamlfind ocamlc -c -package batteries -thread -linkpkg TestIntegerMap.ml
<robthebob> ocamlfind ocamlmktop -package batteries -linkpkg -o TestIntegerMap-toplevel TestIntegerMap.cmo
<robthebob> (ignore -thread on the first line)
<robthebob> and then enter that toplevel, try Enum.force (IntBoxMap.enum IntBoxMap.empty)
svenl_ has joined #ocaml
<robthebob> i get Exception: BatEnum.No_more_elements. rather than ()
<hcarty> robthebob: This may have been fixed in a more recent Batteries. That same code works here for me
tmaeda has quit [Quit: Quit Nadoka 0.7.1-trunk (rev: 187) - http://www.atdot.net/nadoka/]
<hcarty> Batteries 1.2.2 and OCaml 3.12
<robthebob> do you know the reason? i am using batteries 1.2.2 and ocaml 3.11
tmaeda has joined #ocaml
<hcarty> I'm not sure. It works here for me on OCaml 3.11.2 + Batteries 1.2.2 as well
hyperboreean has quit [Ping timeout: 255 seconds]
thelema has quit [Ping timeout: 255 seconds]
svenl has quit [Ping timeout: 255 seconds]
<robthebob> you ran Enum.force (TestIntegerMap.IntBoxMap.enum TestIntegerMap.IntBoxMap.empty);; in the resulting toplevel hcarty ?
<hcarty> I didn't create a custom toplevel. I ran it all from a normal toplevel.
<robthebob> ah well thats the difference
<robthebob> it works fine in the normal toplevel
<robthebob> if you: ocamlfind ocamlc -c -package batteries -linkpkg TestIntegerMap.ml
<robthebob> ocamlfind ocamlmktop -package batteries -linkpkg -o TestIntegerMap-toplevel TestIntegerMap.cmo
<robthebob> then Enum.force (TestIntegerMap.IntBoxMap.enum TestIntegerMap.IntBoxMap.empty);; in TestIntegerMap-toplevel
<robthebob> (to fix some typos in my first set of instructions)
<robthebob> you should get the same problem as me
avsm has quit [Quit: Leaving.]
chee has joined #ocaml
ftrvxmtrx has joined #ocaml
ygrek has joined #ocaml
avsm has joined #ocaml
dcolish has quit [Quit: Coyote finally caught me]
dcolish has joined #ocaml
chee has quit [Ping timeout: 265 seconds]
smimou has joined #ocaml
avsm has quit [Quit: Leaving.]
smimou has quit [Quit: bli]
jakedouglas has quit [Quit: Leaving.]
chee has joined #ocaml
init1 has quit [Quit: Quitte]
tautologico has joined #ocaml
Anarchos has joined #ocaml
oriba has quit [Quit: Verlassend]
jakedouglas has joined #ocaml
sepp2k has quit [Quit: Leaving.]
samo has left #ocaml []
f[x] has quit [Ping timeout: 245 seconds]
f[x] has joined #ocaml
ulfdoz has quit [Quit: deprecated]
chee has quit [Ping timeout: 265 seconds]
<xeno> I'm trying to do this inside a function "pretty_print int tree", and get " This expression has type int -> unit but is here used with type unit". Can't really see why, any obvious thing? List.iter (fun tree -> pretty_print (indent+2) tree) treelist
ulfdoz has joined #ocaml
<gildor> xeno: paste your function here
<xeno> the error is on line 18
<xeno> the tree type is Not(tree), And(tree,tree), Or(tree,tree), Value(int), Or_List(int list), And_List(int list)
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
ygrek has quit [Ping timeout: 245 seconds]
sepp2k has joined #ocaml
<gildor> xeno could you also paste the type tree = ... and an example
<gildor> but I think the answer is: the var tree on l18 is an int not a tree
<xeno> that's the whole file
<gildor> if you want to have something correct
<gildor> List.iter (fun tree -> pretty_print (indent+2) (Value tree)) treelis
<gildor> will do
<xeno> but if I have (Value tree) then it will be an instance of Value, and that's the wrong type...
<gildor> sorry, I was referring to the type you give on IRC
<gildor> And_List(int list)
SEcki has joined #ocaml
<gildor> the error is l35 of your last past bin
<gildor> you forgoet the value in the printf
<gildor> Printf.printf "%s%d\n" (String.make indent ' ') v
<xeno> ah :)
Edward has joined #ocaml
mlh has quit [Ping timeout: 265 seconds]
mlh has joined #ocaml
<xeno> is there a shortcut for let rec function value = match value with ... ?
<xeno> I find that I write that continously
avsm has joined #ocaml
<gildor> let rec f = function
<gildor> (function = fun v -> match v with)
<xeno> thanks
ulfdoz has quit [Read error: Operation timed out]
ccasin has quit [Quit: Leaving]
jakedouglas has quit [Ping timeout: 246 seconds]
SEcki has quit [Remote host closed the connection]
shawnps has quit [Read error: Operation timed out]
avsm has quit [Quit: Leaving.]
shawnps has joined #ocaml
jakedouglas has joined #ocaml
_unK has quit [Remote host closed the connection]
ikaros_ has quit [Quit: Leave the magic to Houdini]
__mattam__ has joined #ocaml
__mattam__ has quit [Client Quit]
Edward has quit []
joewilliams is now known as joewilliams_away