<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]
<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