<evn_>
i had been trying to use sexplib to print stuff, maybe extlib is the better way
<thelema>
if you were to put a "finally" (as in try..finally) function into the ocaml stdlib, what module would it go in?
<thelema>
(alternatively, what module would you look in for a finally function)
<mwc>
thelema, in Pervasives
<AxleLonghorn>
does anyone know why this is a syntax error?
<AxleLonghorn>
let best = ref -1 in ...
<thermoplyae>
ref (-1) will work
<AxleLonghorn>
yeah
<AxleLonghorn>
is it because it thinks the - is subtraction?
<thermoplyae>
i'm not sure if it parses it as (ref -)1 or (ref) - (1)
<thermoplyae>
but one of those two is the default and that messes it up
<AxleLonghorn>
k
<AxleLonghorn>
thanks
<mwc>
I think the problem is that function application is tighter than unary negation.
<mwc>
s/tighter/higher precedence/
<mwc>
and by function application I mean juxtaposition
thermoplyae has quit ["daddy's in space"]
petchema has quit [Read error: 113 (No route to host)]
ttamttam has joined #ocaml
<flux>
I just yesterday showed a piece of simpleish ocaml code to a friend, who is familiar with perl. her comment was that the location of ';' looked arbitrary, and the location of 'function' keyword was strangely after '='.
<flux>
I've often heard it been said that ocaml's worst feature is its syntax, I wonder if for example those things are part of it
seafood_ has joined #ocaml
<mwc>
Compared to Haskell, Ocaml's syntax is awful
<mwc>
though I later learned some gems in it
<mwc>
like why it uses , for tupling and ; for lists
<mwc>
makes it nice to do things like [ 2 , 3 ; 4 , 5 ; 6 , 7 ]
<mwc>
but yeah, I've had to track down some obscure bugs because the syntax is misleading sometimes
<mwc>
though, the fact that a perl coder had the gall to criticize syntax is somewhat amusng
<flux>
on that critiziced level it's not that different from, say, c++
love-pingoo has joined #ocaml
bluestorm has joined #ocaml
mwc has quit ["Leaving"]
seafood_ has quit []
AxleLonghorn has left #ocaml []
goalieca has quit ["(doing some misty mountain hop)"]
evn_ is now known as noob
filp has joined #ocaml
love-pingoo has quit ["Connection reset by pear"]
<flux>
hm, can I allocate an ocaml data block from C with a finalizer function?
<flux>
if I use caml_alloc_custom, doesn't that mean ocaml gc won't try to follow ocaml values from that block?
<flux>
there is Gc.finalise, but for some reason it doesn't appear to be directly accessible from C?-o and it registers an ocaml function..
<flux>
I suppose I still could use that. or is there a way to allocate a custom block but still make gc interested in it?
petchema has joined #ocaml
<bluestorm>
flux:
<bluestorm>
« The contents of custom blocks are not scanned by the garbage collector, and must therefore not contain any pointer inside the Caml heap. In other terms, never store a Caml value in a custom block, and do not use Field, Store_field nor modify to access the data part of a custom block. »
<bluestorm>
(wouldn't a product type (in_heap_data * custom out_of_heap_data) suit your needs ?
<bluestorm>
)
<flux>
I have a bunch of ocaml values in a tuple and a few C pointers too, and I'd like to clear the c pointers when the tuple goes unreachable
<bluestorm>
hm
<bluestorm>
could you wrap the C values in individual custom values ?
<flux>
yes, that's actually what I'm doing/coding
<bluestorm>
then from the ocaml standpoint you'd have a tuple of ocaml and custom values
<flux>
but that means a double indirection.. I suppose I can live with that.
<flux>
however I think in theory I could be able to solve the issue by using Gc.finalise, without such intermediate custom block
dwmw2_gone is now known as dwmw2
munga has joined #ocaml
Submarine has joined #ocaml
<Submarine>
Smerdyakov: howdie
<Submarine>
Smerdyakov: Would you know by chance a reference for the conjecture that CoNP != NP?
<Submarine>
Smerdyakov: I know everybody believes it, I know the contrary would mean the collapse of the polynomial hierarchy and other horrors, but more precisely?
Yoric[DT] has joined #ocaml
<Yoric[DT]>
hi
olleolleolle has joined #ocaml
ttamttam has left #ocaml []
hkBst has joined #ocaml
LordMetroid has joined #ocaml
olleolleolle has quit [Read error: 113 (No route to host)]
<Yoric[DT]>
Mmhhh....
<Yoric[DT]>
I have a value [> ].
<Yoric[DT]>
Oh, sorry, misread the error message.
Snrrrub has quit [Read error: 110 (Connection timed out)]
<Submarine>
Smerdyakov: our work area lacks good up-to-date reference books
oriba has joined #ocaml
<Smerdyakov>
Submarine, BTW, if you have a question for me, you might want to e-mail it instead of posting it in this channel when I'm marked away. :P
<Submarine>
I have the Garey/Johnson book on my desk, and it has not been updated to the fact that primality is in P, and... in fact, the text does not even say that linear programming is in P (they have very short update text at the end that notes so).
<Submarine>
good point
OChameau has joined #ocaml
seafood_ has quit []
Yoric[DT] has quit ["Ex-Chat"]
bongy has quit ["Leaving"]
dwmw2_gone is now known as dwmw2
<munga>
do I need to write a plugin if I want to compile with ocamlbuild with the help of ocamlfind ?
<bluestorm>
there is something about that in the documentation
<Yoric[DT]>
Of course, you can escape try...catch if you return a continuation and the exception is actually thrown from inside that continuation.
<ziph>
Hmm, that looks interesting, but I shouldn't mentioned I was using F#. ;)
<bluestorm>
ziph: then go away and die in pain :-'
<Yoric[DT]>
:)
<ziph>
:~( ;)
<Yoric[DT]>
Now, that sounds like a good reason to use monads.
Mr_Awesome has joined #ocaml
TheLittlePrince has joined #ocaml
Waleee has joined #ocaml
middayc has joined #ocaml
middayc_ has joined #ocaml
middayc has quit [Read error: 110 (Connection timed out)]
evn has quit []
zmdkrbou_ has joined #ocaml
oriba has quit ["Verlassend"]
pango has quit [Remote closed the connection]
AxleLonghorn has joined #ocaml
AxleLonghorn has left #ocaml []
dwmw2 is now known as dwmw2_gone
zmdkrbou has quit [Read error: 113 (No route to host)]
pango has joined #ocaml
Morphous has joined #ocaml
Linktim has joined #ocaml
Morphous_ has quit [Read error: 110 (Connection timed out)]
delamarche has joined #ocaml
filp has quit ["Bye"]
munga has quit ["Leaving"]
Linktim_ has joined #ocaml
delamarche has quit []
dwmw2_gone is now known as dwmw2
Linktim has quit [Read error: 110 (Connection timed out)]
Yoric[DT] has quit [Read error: 110 (Connection timed out)]
<stugy>
Hey, I've got an external ocaml library, but it's in a non-standard location. I'm trying to use EXTLIBDIRS in OcamlMakefile to make the .so in the runtime search path, but running fails with a "cannot open shared object file"
ziph has quit []
<bla>
stugy, if talking about runtime search path
<bla>
Try rather defining LD_LIBRARY_PATH
<bla>
It's ld.so which is supposed to link .so libraries with your program.
<bla>
Also check 'ldd', and 'ld' manuals. ldd can be particularly usefell.
<stugy>
Yes, it works when I define LD_LIBRARY_PATH, but OCamlMakefile suggests that setting EXTLIBDIRS will imprint the linking information into the executable