rwmjones changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab Ocaml 3.10.1 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
<Yoric[DT]> Anyway, it's getting late.
<Yoric[DT]> Goodnight everyone.
Yoric[DT] has quit ["Ex-Chat"]
hkBst_ has quit [Client Quit]
chacun has joined #ocaml
middayc_ has joined #ocaml
mfp_ has joined #ocaml
mfp has quit [Read error: 110 (Connection timed out)]
middayc has quit [Read error: 110 (Connection timed out)]
delamarche has quit [Read error: 104 (Connection reset by peer)]
delamarche has joined #ocaml
postalchris has quit [Read error: 110 (Connection timed out)]
middayc_ has left #ocaml []
jlouis_ has joined #ocaml
jlouis has quit [Read error: 110 (Connection timed out)]
LordMetroid has quit ["Leaving"]
AxleLonghorn has joined #ocaml
seafood_ has quit []
chacun has quit []
Snrrrub has quit [Read error: 110 (Connection timed out)]
coucou747 has quit ["bye ca veut dire tchao en anglais"]
ben__ has joined #ocaml
ben__ is now known as ziph
Snrrrub has joined #ocaml
stugy has joined #ocaml
evn_ has joined #ocaml
ulfdoz has quit [brown.freenode.net irc.freenode.net]
evn has quit [brown.freenode.net irc.freenode.net]
katz has quit [brown.freenode.net irc.freenode.net]
thelema has quit [brown.freenode.net irc.freenode.net]
seafood has quit [brown.freenode.net irc.freenode.net]
jonafan has quit [brown.freenode.net irc.freenode.net]
Dazhbog has quit [brown.freenode.net irc.freenode.net]
awesame has quit [brown.freenode.net irc.freenode.net]
netx has quit [brown.freenode.net irc.freenode.net]
rwmjones has quit [brown.freenode.net irc.freenode.net]
mbishop has quit [brown.freenode.net irc.freenode.net]
l_a_m has quit [brown.freenode.net irc.freenode.net]
stugy has quit [brown.freenode.net irc.freenode.net]
sgnb has quit [brown.freenode.net irc.freenode.net]
qwr has quit [brown.freenode.net irc.freenode.net]
gim has quit [brown.freenode.net irc.freenode.net]
sgnb` has joined #ocaml
stugy has joined #ocaml
sgnb has joined #ocaml
jonafan has joined #ocaml
rwmjones has joined #ocaml
netx has joined #ocaml
seafood has joined #ocaml
ulfdoz has joined #ocaml
mbishop has joined #ocaml
awesame has joined #ocaml
thelema has joined #ocaml
Dazhbog has joined #ocaml
katz has joined #ocaml
l_a_m has joined #ocaml
gim has joined #ocaml
qwr has joined #ocaml
sgnb has quit [Read error: 104 (Connection reset by peer)]
qwr has quit [Read error: 104 (Connection reset by peer)]
qwr has joined #ocaml
<AxleLonghorn> so I'm trying to use the Str module.
<AxleLonghorn> How do I import it?
delamarche has quit []
<tsuyoshi> what do you mean by import?
<musically_ut> AxleLonghorn, open String;; maybe?
<AxleLonghorn> well, open List;; works
<AxleLonghorn> but not open Str;;
<thelema> AxleLonghorn: when you compile, make sure to link with str.cmo (or str.cmxa)
<AxleLonghorn> is that the only way?
<thelema> err, cma/cmxa
<AxleLonghorn> I was just going to use with the interactive ocaml
<AxleLonghorn> *it
<thelema> with interactive, #load "str.cma"
<AxleLonghorn> ok
<AxleLonghorn> thanks
<thelema> (if dynamic linking of C libraries is supported on your system)
<hcarty> AxleLonghorn: If you have findlib, then you can "#use "topfind";;" then "#require "str";;" as well
<AxleLonghorn> hmm... with the interactive one, it doesn't appear to be working
<AxleLonghorn> I type "#load "str.cma";;", then "#use "problem18.ml";;"
<AxleLonghorn> I still get "Unbound value split"
<thelema> try using ocamlmktop
<thelema> what platform are you on?
<AxleLonghorn> ubuntu gutsy
<AxleLonghorn> mktop doesn't work
<AxleLonghorn> still unbound value split
<hcarty> AxleLonghorn: Have you used "open Str"?
<AxleLonghorn> whoops
<hcarty> #load does not open the module automatically
<AxleLonghorn> yeah, forgot that
<AxleLonghorn> it works now
<AxleLonghorn> why does the system work like that?
<AxleLonghorn> why can you use open List;; but not open Str;; ?
<thelema> List is part of the stdlib. Str isn't. It's a separate library that's included with the compiler.
<AxleLonghorn> hmm
<AxleLonghorn> thanks all
<thelema> cheers
postalchris has joined #ocaml
postalchris has quit [Client Quit]
musically_ut has quit [Remote closed the connection]
<stugy> Hey, does anyone know the relative usefulness/stability of lacaml, camlfloat, and ocamlgsl?
<hcarty> RobertFischer: http://ocaml.pastewith.us/43 - A sort-of start for COAN, with more to come
<hcarty> stugy: I have used ocamlgsl
<hcarty> lacaml seems to be well maintained
<stugy> What did you think of it?
<hcarty> RobertFischer: No actual package building or anything of that nature... just a few dependency checks
<hcarty> ocamlgsl seems to work well. I have not had any crashes/segfaults or anything of that nature with it.
<hcarty> I have done some simple (and incorrectly implemented on my end) curve fitting, and a lot of statistics using ocamlgsl
<stugy> hcarty: thanks. I'll give it a shot
<hcarty> When I get back to the curve fitting problem again, I plan on trying out lacaml
<hcarty> Best of luck
<stugy> I've used blas/lapack bindings in other languages and had good look with them, but I guess I'll try out gsl first here
jlouis has joined #ocaml
Mr_Awesome has quit ["aunt jemima is the devil!"]
mwc has joined #ocaml
jlouis_ has quit [Read error: 110 (Connection timed out)]
<stugy> hcarty: do you know how to print out a matrix?
seafood_ has joined #ocaml
seafood_ has quit [Client Quit]
|Catch22| has quit []
<thelema> stugy: print a matrix one row at a time. OCaml doesn't give you a predefined way, but Array.iter will help.
<stugy> thelema: thanks. I remember hearing something about "custom printers" for the ocaml toplevel. I was hoping something existed
<thelema> the toplevel's printer cheats because it has access to type information that doesn't get included in a compiled program.
<stugy> smart
<stugy> all I'm looking for right now is a toplevel printer
<thelema> stugy: apparently ExtLib has a dump function in its sys module.
<thelema> err, std.
<stugy> thelema: thanks, I'll have a look
<thelema> http://pastebin.ca/930016 std.ml
<stugy> thanks
<evn_> hmm
<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)]
seafood_ has joined #ocaml
StoneNote has quit []
coucou747 has joined #ocaml
dwmw2 is now known as dwmw2_gone
bongy has joined #ocaml
<Smerdyakov> Submarine, we might have covered it in this class: http://www.cs.berkeley.edu/~luca/cs278-04/
<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
<munga> yep, thanks !
* RobertFischer wakes up.
Yoric[DT] has joined #ocaml
<Yoric[DT]> Erf, the debugger is sloooooow.
<RobertFischer> Ocaml has a debugger?
<Yoric[DT]> And a powerful one with that.
<Yoric[DT]> It's just sloooow.
<RobertFischer> Nifty.
<Yoric[DT]> Mhhh....
<Yoric[DT]> Things start to look bad when adding printf to your crashing code makes it work.
<bluestorm> says the guy who can paste correct code to a pastebin and add stealth bugs later
<ziph> Is there any way to do "let a :: b = [1; 2; 3] in a" while handling a non-match? (Rather than getting the warning?)
<Yoric[DT]> :)
<Yoric[DT]> Well, I have slept this night so I expect to work a bit more efficiently.
<Yoric[DT]> ziph: there's a "refutable" extension for this kind of things.
<bluestorm> :]
evn has joined #ocaml
<Yoric[DT]> Okay, found my bug.
<Yoric[DT]> It's nasty.
<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
<stugy> Sweet, I just hacked it in: OCAMLLDFLAGS += -dllpath $(ODE)/
<bla> Hm.
<bla> Mkay.
<stugy> Thanks for helping
Linktim_ has quit [Read error: 110 (Connection timed out)]
dwmw2 is now known as dwmw2_gone
Yoric[DT] has joined #ocaml
dwmw2_gone is now known as dwmw2
* Yoric[DT] is brooding about his bug.
* RobertFischer pats Yoric[DT] on the back.
<RobertFischer> There, there. It's okay.
marmottine has joined #ocaml
jderque has joined #ocaml
<Yoric[DT]> Thanks, you're a pal.
cygnus__ has quit [Remote closed the connection]
cygnus_ has joined #ocaml
ygrek has joined #ocaml
TheLittlePrince has quit [Client Quit]
OChameau has quit ["Leaving"]
zmdkrbou_ is now known as zmdkrbou
Walee has joined #ocaml
delamarche has joined #ocaml
Submarine has quit ["Leaving."]
Linktim_ has joined #ocaml
dwmw2 is now known as dwmw2_gone
lordmetroid_ has joined #ocaml
lordmetroid_ has quit [Read error: 104 (Connection reset by peer)]
marmottine has quit [Remote closed the connection]
lordmetroid_ has joined #ocaml
Waleee has quit [Read error: 110 (Connection timed out)]
LordMetroid has quit [Connection timed out]
Linktim_ has quit [Read error: 110 (Connection timed out)]
middayc_ has quit [Read error: 104 (Connection reset by peer)]
middayc has joined #ocaml
<Yoric[DT]> Mmmhhh....
* Yoric[DT] might have a workaround using local modules.
<mattam> Anyone knows what changed regarding infix operators in 3.10 ? I can't define let ($) g f = fun x -> g (f x) and use it like "f $ arg" anymore
<bluestorm> i'd bet you can
<bluestorm> hmm
<bluestorm> f $ arg ?
<mattam> I just said it's a compile time error if I don't change the code
<bluestorm> hm
<mattam> Yes, using an infix operator in infix position...
<bluestorm> yes, but i mean that
<bluestorm> $ is a function composition operator
<Yoric[DT]> Unless I completely misunderstand the question, it works for me.
<bluestorm> if you want to use it as a function application operator, like the Haskell's $, you can't
<bluestorm> (the way you defined it)
<mattam> I know it's the . of haskell
<bluestorm> hm
<bluestorm> they it should work
<bluestorm> could you paste your code somewhere ?
<bluestorm> ( http://pastebin.be has OCaml coloration )
<mattam> It's simple enough to copy paste it, the real code is burried in a big file
<mattam> Yoric[DT]: you mean you can do the let ($) .. and then write "f $ arg" and it works (under caml 3.10) ?
<bluestorm> of course
<bluestorm> # print_newline $ print_string;;
<bluestorm> - : string -> unit = <fun>
<mattam> Okay. Can you do it in a camlp4 file now ?
<bluestorm> hmm
<bluestorm> so this is a camlp4-specific issue ?
<mattam> Probably.
<bluestorm> "camlp4o test.ml" does print the code fine
<bluestorm> definitely seems to work
<bluestorm> ocamlc -pp camlp4o compiled the code fine
<mattam> Hmm. Getting weirder.
<bluestorm> there is a bug 3.10.0 concerning (mod) and the like
<bluestorm> fixed in 3.10.1 iirc
<mattam> Oh.. that's in a syntax extension definition.. maybe that triggers it. Anyway, thanks for helping
<bluestorm> aha.
<bluestorm> $ camlp4oof test.ml
<bluestorm> File "test.ml", line 3, characters 25-40 (end at line 4, character 0):
<bluestorm> Antiquotation not terminated
lordmetroid__ has joined #ocaml
<bluestorm> let's see
lordmetroid__ is now known as LordMetroid
<mattam> Are you using camlp4 or camlp5 ?
<bluestorm> camlp4
<mattam> Maybe that's it
<bluestorm> mattam: you're using camlp5 ?
<bluestorm> on camlp4, i might have a fix
<bluestorm> (but i suppose it break some other things i don't know of, though you could try)
thermoplyae has joined #ocaml
lordmetroid_ has quit [Connection timed out]
<mattam> bluestorm: I'm not, but the code should be compatible with both. I just changed it.
<bluestorm> hm
<bluestorm> the idea is that antiquotation parsing is actived when the Camlp4_config variable is set to true
<bluestorm> so adding a simple module foo.cmo compiled from a file containing "Camlp4_config.antiquotations := false"
<bluestorm> works as a fix
<bluestorm> it seems that the antiquotations inside quotations still works (i've done a little test)
<bluestorm> and i don't see how one would want to use antiquotations outside quotations
<thelema> mattam: the best solution involves giving up on using '$' as your identifier. Can you choose something else?
ttamttam has joined #ocaml
<bluestorm> (the foo.cmo has to be added as a camlp4 parameter, of course : camlp4oof fooc.mo test.ml works )
<mattam> thelema: I could, but I'm not really interested in a fix anymore, thank you :)
jlouis_ has joined #ocaml
jlouis has quit [Read error: 110 (Connection timed out)]
Snrrrub has joined #ocaml
jderque has quit ["leaving"]
lordmetroid_ has joined #ocaml
ttamttam has left #ocaml []
<RobertFischer> Alright, who do I guess for JoCaml?
<RobertFischer> (s/guess/kiss/)
<RobertFischer> That totally made my life simple.
<thelema> The new JoCaml is a re-implementation of the now unmaintained JoCaml by Fabrice Le Fessant
thermoplyae has quit ["daddy's in space"]
<thelema> it seems Louis Mandel and Luc Maranget hold most responsibility for the new version
<bluestorm> RobertFischer: did you manage to use your code mobility thing ?
LordMetroid has quit [Connection timed out]
<RobertFischer> bluestorm: Dynlink worked just fine.
<RobertFischer> bluestorm: It's pretty low-level, but it worked.
lordmetroid__ has joined #ocaml
lordmetroid__ has quit [Client Quit]
Illocution has quit ["Lost terminal"]
Illocution has joined #ocaml
ygrek has quit [Remote closed the connection]
middayc_ has joined #ocaml
lordmetroid_ has quit [Success]
ita has joined #ocaml
RobertFischer has left #ocaml []
middayc has quit [Read error: 110 (Connection timed out)]
thermoplyae has joined #ocaml
ita has quit [Remote closed the connection]
jonathanv has joined #ocaml
jonafan has quit [Nick collision from services.]
jonathanv is now known as jonafan
Walee has quit [Read error: 110 (Connection timed out)]
hsuh has joined #ocaml
LordMetroid has joined #ocaml
StoneNote has joined #ocaml
hsuh has quit ["rcirc on GNU Emacs 23.0.60.2"]