flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.0 out now! Get yours from http://caml.inria.fr/ocaml/release.html
<mfp> (also *.cmx optionally if you want functions from those modules to be inlined)
<mfp> oops, ocamlfind install xml-light META xml-light.cma xml-light.cmxa *.mli *.cmi of course
<mfp> (package name first)
<theneb> yeah, was getting an error
<theneb> sorted!
<theneb> cheers for the help mfp
<mfp> np
m3ga has joined #ocaml
alexyk has joined #ocaml
jeanbon has quit ["J'y trouve un goût d'pomme."]
ulfdoz has quit [Read error: 110 (Connection timed out)]
hkBst has quit [Read error: 104 (Connection reset by peer)]
willb has quit [Read error: 110 (Connection timed out)]
Camarade_Tux has quit ["Leaving"]
jamii has quit [Read error: 110 (Connection timed out)]
alexyk has quit []
alexyk has joined #ocaml
jeddhaberstro has joined #ocaml
alexyk has quit []
seafood has joined #ocaml
jlouis has joined #ocaml
alexyk has joined #ocaml
mfp_ has joined #ocaml
mfp has quit [Read error: 110 (Connection timed out)]
alexyk has quit []
Ched has quit [Read error: 60 (Operation timed out)]
Ched has joined #ocaml
vuln has quit ["leaving"]
jeddhaberstro has quit []
kaustuv_ has quit [Read error: 104 (Connection reset by peer)]
alexyk has joined #ocaml
mrvn has quit [Read error: 110 (Connection timed out)]
|jedai| has quit [Read error: 60 (Operation timed out)]
schme has quit ["leaving"]
ulfdoz has joined #ocaml
Patrick_O has joined #ocaml
Patrick_O has left #ocaml []
m3ga has quit [Remote closed the connection]
munga has quit [Read error: 60 (Operation timed out)]
munga has joined #ocaml
kaustuv has quit [Read error: 104 (Connection reset by peer)]
kaustuv_ has joined #ocaml
alexyk has quit []
mrvn has joined #ocaml
Camarade_Tux has joined #ocaml
m3ga has joined #ocaml
Camarade_Tux has quit ["Leaving"]
verte has joined #ocaml
m3ga has quit ["disappearing into the sunset"]
m3ga has joined #ocaml
_zack has joined #ocaml
Alpounet has joined #ocaml
hkBst has joined #ocaml
Alpounet has quit [Read error: 110 (Connection timed out)]
Alpounet has joined #ocaml
s4tan has joined #ocaml
olegfink has quit [Remote closed the connection]
olegfink has joined #ocaml
_zack has quit ["Leaving."]
r0bby_ has joined #ocaml
rwmjones_ has joined #ocaml
r0bby has quit [Connection timed out]
_zack has joined #ocaml
mfp_ is now known as mfp
jeanbon has joined #ocaml
Alpounet has quit ["Ex-Chat"]
sgnb has quit [Read error: 104 (Connection reset by peer)]
sgnb has joined #ocaml
mehdid has left #ocaml []
kaustuv_ is now known as kaustuv
verte_ has joined #ocaml
verte has quit [Nick collision from services.]
verte_ is now known as verte
jamii has joined #ocaml
Yoric[DT] has joined #ocaml
m3ga has quit ["disappearing into the sunset"]
seafood has quit []
_andre has joined #ocaml
_zack has quit ["Leaving."]
jeanbon has quit [Read error: 113 (No route to host)]
rwmjones_ has quit ["Closed connection"]
Camarade_Tux has joined #ocaml
Alpounet has joined #ocaml
bzzbzz has joined #ocaml
willb has joined #ocaml
schme has joined #ocaml
filp has joined #ocaml
_zack has joined #ocaml
<Alpounet> what is the correct regular expression that matches when it starts with, say, "XXX" ?
|jedai| has joined #ocaml
AxleLonghorn has joined #ocaml
<flx_> ^XXX
<flx_> btw, I bet there are tons of howtos related to the matter, if the docs fail ;-)
verte has quit ["http://coyotos.org/"]
<Alpounet> damn it... forgot the ^
<Alpounet> thanks... was wondering why it didn't work.
|jedai| has quit [Read error: 145 (Connection timed out)]
<flx_> I think there might be regular expression explainers around, that might help to learn regexps the backwards way ;)
burton_ has joined #ocaml
<burton_> hello world
<burton_> i'm trying to compile an ocaml software wich needs lablgladecc2 but can't find it. I've compiled and installed lablgtk2 but it doesnt make the trick
<burton_> any idea?
<Camarade_Tux> burton_, do you have libglade on your system ?
<burton_> yep
<hcarty> burton_: You probably need the lablgtk2-dev package + dependencies as well
<burton_> hcarty: in my distribution (archlinux) there are no -dev packages, everything is in the normal
<Camarade_Tux> also, there is a --with(out)-glade ./configure switch when building lablgtk2
<burton_> Camarade_Tux: mmh i'll try that
<burton_> Camarade_Tux: It doesn't seem to do the trick :(
<Camarade_Tux> burton_, does lablgtk configure script tell you what is enabled and what is disabled ?
<burton_> Camarade_Tux: I only have labltk :/
<Camarade_Tux> also, check the content of config.log, it's created by configure, and look for 'glade'
<burton_> oups
<Camarade_Tux> hmmm, you said you had compiled and installed lablgtk2
<burton_> yes, i misread
<burton_> when it does the configure it finds libglade
<Camarade_Tux> was lablgtk2 already installed on your system ?
<burton_> no
hastake has joined #ocaml
<Camarade_Tux> have you tried something as 'find /usr -name "*lablglade*"' ?
<hastake> oh hai there
<burton_> well I installed it with my packages manager, then uninstalled and tried to recompile it
<burton_> $ find /usr -name "*lablglade*"
<burton_> /usr/lib/ocaml/stublibs/dlllablglade2.so
<burton_> /usr/lib/ocaml/lablgtk2/lablglade.cmxa
<burton_> /usr/lib/ocaml/lablgtk2/lablglade.cma
<burton_> /usr/lib/ocaml/lablgtk2/liblablglade2.a
<burton_> /usr/lib/ocaml/lablgtk2/lablglade.a
Associat0r has joined #ocaml
Associat0r has quit [Read error: 104 (Connection reset by peer)]
yziquel_ has joined #ocaml
Associat0r has joined #ocaml
Associat0r has quit [Read error: 104 (Connection reset by peer)]
Amorphous has quit [Read error: 110 (Connection timed out)]
<Camarade_Tux> burton_, and does lablgladecc2 exist in your build tree ?
Amorphous has joined #ocaml
<burton_> Camarade_Tux: lablgladecc does but lablgladecc2 doesnt
<burton_> and lablgladecc isn't installed after the build
<Camarade_Tux> maybe they are the same after all, does it accept any switch that makes it print its version (like --version)
<Camarade_Tux> ?
<burton_> Camarade_Tux: well seen :
<burton_> $ ./lablgladecc --version
<burton_> ./lablgladecc: unknown option `--version'.
<burton_> lablgladecc2 [<options>] [<file.glade>]
<burton_> (...)
<burton_> do I just cp it somewhere?
<Camarade_Tux> nice it's actually lablgladecc2, try copying to the same location lablgtk2 reside in on your system (see the output of 'which lablgtk2')
<burton_> Camarade_Tux: I just cp-ed into /usr/bin and it works \o/
<burton_> thanks for the help :)
<Camarade_Tux> =)
<_andre> what's the proper way to evaluate a LIST0 of expressions in camlp4?
<_andre> something like http://codepad.org/jBPTaVmb
<_andre> i tried variations of that but i can't get it to work :/
<burton_> Camarade_Tux: if I can bother you again : is "Error: Unbound value mkenv" an ocaml common error?
<Camarade_Tux> I don't think I ever got that one but it's hard to say anything without context
hcarty has quit [Remote closed the connection]
hcarty has joined #ocaml
<mfp> _andre: "evaluate"? (at compile time)
<_andre> well maybe that isn't the correct term... what i mean is basically doing the same as "do_sequence" but limiting it to "foo" items instead of any expression
<_andre> i mean, do_sequence captures a series of expressions, and i can just do <:expr< $seq$ >> to "evaluate" them
<_andre> to get just "foo", i'm doing "seq = LIST0 foo" instead of "seq = do_sequence"
<_andre> but then i don't know how to work with that
<mfp> _andre: something like http://ocaml.pastebin.com/m4548bbcf ?
<_andre> yes :)
<_andre> didn't know about do { } :(
<mfp> revised syntax in the quotations
alexyk has joined #ocaml
<mfp> unless you use camlp4oof, which is buggier and maybe not as complete as camlp4orf
<_andre> i'm just getting started with camlp4, but it's been kind of a trial and error process
<mfp> the best reference is camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml
<_andre> is "expr" a pre-defined pattern that matches every ocaml expression?
<mfp> it's one of the productions defined in the OCaml parsers (Camlp4OCamlRevisedParser.ml and Camlp4OCamlParser.ml)
AxleLonghorn has quit [Read error: 110 (Connection timed out)]
thelema_ has joined #ocaml
<_andre> so in that example you pasted, what you're doing is redefining it?
thelema has quit [Nick collision from services.]
thelema_ is now known as thelema
thelema_ has joined #ocaml
<_andre> if i do let x = Gram.Entry.mk "x" and then use "x:" instead of "expr:" it breaks the example
<mfp> _andre: of course, how would it know it's got to use x, and where it fits in the existent OCaml grammar?
<mfp> you can specify you want to parse another non-terminal, but by default it'll use top_phrase (which expands to phrase -> str_item -> expr, etc.) or so
<mfp> you can try something like Gram.parse_string x Loc.ghost text which will evaluate to the AST
mfp has left #ocaml []
_zack has quit ["Leaving."]
<hcarty> Yoric[DT]: ping
jlouis has quit ["Lost terminal"]
xevz has quit [":wq"]
xevz has joined #ocaml
jlouis has joined #ocaml
s4tan has quit []
willb has quit [Read error: 110 (Connection timed out)]
<Yoric[DT]> hcarty: pong
alexyk has quit []
ttamttam has joined #ocaml
Alpounet has quit [Remote closed the connection]
ttamttam has left #ocaml []
<hcarty> Yoric[DT]: Is there a current checklist and/or timeline for the Batteries beta 1 release?
|jedai| has joined #ocaml
<hcarty> Two questions on the Batteries details: Why are the %(list foo) arguments in the "revised syntax" order rather than standard syntax order?
<hcarty> And why is the Exceptions module named Exceptions rather than Exception?
<Yoric[DT]> hcarty: well, timeline was supposed to be one or two days ago.
<Yoric[DT]> But there were a few last-minute bugfixes, which thelema is checking at the moment.
<Yoric[DT]> hcarty: for the first question, you should ask on the mailing-list, to Jérémie.
<Yoric[DT]> (I haven't checked that part of the syntax yet myself)
<Yoric[DT]> For Exceptions, good remark.
<thelema> yor: I checked in the bits I thought safe - the testing code didn't make it.
<hcarty> Yoric[DT]: Ok, thanks. I'll ask about the Print.* syntax on the list
jeanbon has joined #ocaml
<hcarty> Is there a .ocamlinit equivalent for the Batteries toplevel?
Snark has joined #ocaml
<Yoric[DT]> hcarty: normally, .ocamlinit should work.
<Yoric[DT]> thelema: ok
<Yoric[DT]> Did you find out more about that problem with String.quote?
<thelema> Yoric[DT]: me - string.quote?
<Yoric[DT]> thelema: the e-mail regarding the patches mentioned a problem with String.quote and finalization.
<thelema> that was probably hiding in the testing patches, and I didn't pull it apart.
<thelema> No, I've not worked on that. Maybe after Aikido tonight.
<kaustuv> What's everyone's favourite naming convention for functions of type [t -> bool]? (prefixed with is_, suffixed with _p, ...)
willb has joined #ocaml
<Yoric[DT]> I'd say [is_... ].
<hcarty> Yoric[DT]: "ocamlfind batteries/ocaml" does not seem to use ~/.ocamlinit on my system (GODI, OCaml 3.11, latest Batteries from git as of a few hours ago)
sporkmonger has joined #ocaml
<Yoric[DT]> mmmmhh...
<Yoric[DT]> Could you submit a bug report?
<hcarty> Sure
<Yoric[DT]> Oh, yeah, I know why.
<Yoric[DT]> That should be fixed by an upcoming patch.
<hcarty> Yoric[DT]: Should I still submit a bug report?
<Yoric[DT]> Yes please, that will help us track that issue.
alexyk has joined #ocaml
<hcarty> Done
Alpounet has joined #ocaml
filp has quit [calvino.freenode.net irc.freenode.net]
kaustuv has quit [calvino.freenode.net irc.freenode.net]
maxote has quit [calvino.freenode.net irc.freenode.net]
filp has joined #ocaml
kaustuv has joined #ocaml
maxote has joined #ocaml
filp has quit ["Bye"]
alexyk has quit []
|jedai| is now known as jedai
alexyk has joined #ocaml
bzzbzz has quit ["leaving"]
_andre has quit ["Lost terminal"]
ttamttam has joined #ocaml
Snark has quit ["Ex-Chat"]
<kaustuv> I'm writing a binding for a C library that has an enumeration with 171 values. Is it considered good hygiene to represent it with a variant with 171 constructors?
schme has quit ["leaving"]
<mrvn> kaustuv: what other way is there?
DNE has joined #ocaml
<mrvn> Me hates defining an 'unsafe_string : buffer -> string' that is only valid as long as buffer is bound but sees no way around it.
DNE has left #ocaml []
alexyk has quit []
jamii has quit [Read error: 54 (Connection reset by peer)]
<thelema> kaustuv: I see no problem with using a normal variant type for that.
yziquel_ has quit ["http://www.mibbit.com ajax IRC Client"]
seafood has joined #ocaml
ttamttam has left #ocaml []
m3ga has joined #ocaml
Camarade_Tux has quit ["Leaving"]
Alpounet has quit ["Ex-Chat"]
<det> kaustuv, Depending on the interface, I'd probably just use integers with an abstract type.
<det> But it really depends on how they are used, if you need to match on the from user code, then variants/polymorphic variants are required.
<mrvn> det: makes it hard if you need the type in ocaml. Otherwise sure, keep it abstract.
<det> I mean, abstract outside the module
<mrvn> det: you mean hide it in the mli. Doens't help answering the question. :)
<det> kaustuv's question ?
<mrvn> What I would like is a camlp4 module to convert the "enum Foo {X, Y, Z, ...}" into ocaml type foo = X | Y | Z so you only have to define it once and it will always be in sync.
<det> You mean, parse the .h as part of the build process ?
<mrvn> det: yes. Or some common file that both ocaml and c can parse.
<det> That would be nice (parsing the .h)
<mrvn> In C '#define | ,' and '#include "foo.mlh"'.
<det> I guess you could keep it in sync by writing the the conversion to int function in C
<mrvn> In C '#define | ,' and 'enum { #include "foo.mlh" };' I mean.
<det> You could even use names, if you use polymorphic variants
<mrvn> In Ocaml 'type foo = #inlcude "foo.mlh"' and foo.mlh: X | Y | Z
<det> switch () ...
<det> case hash_variant("GL_MAT"): return GLMAT; break;
<mrvn> det: Type foo = X | Y | Z becomes 0, 1 or 2. Not a hash.
<det> for polymorphic variants too ?
<det> no
<mrvn> type foo = `X | `Y | `Z would be hashed.
<det> Yes
<det> that is what I am talking about
<det> <det> You could even use names, if you use polymorphic variants
<mrvn> right. Polymorphic variants are another deal. But I don't think you can use 'case hash_variant("GL_MAT"):' That is not a compile time const.
<det> polymorphic variants often make the most sense for C interfaces
<det> Right, you'd probably have an init function that did all the hash_variants()
<det> oh wait
<det> I guess you still cant do that
<mrvn> and then you need a hashtable to look them up or a tree and search.
<mrvn> Can camlp4/5 do an #include?
<mrvn> Short of that I would preprocess a file to generate both the C and OCaml source for the enum.
<mrvn> For bindings generate 2 int arrays in C, enum -> ocaml variant und ocaml variant -> enum.
<mrvn> or some code that outputs the enum sorted by number and gaps filled in as ocaml type.
<Yoric[DT]> mrvn: yep, there's INCLUDE
<mrvn> Have to investigate that for the fuse bindings. I need a mapping for errno.
<kaustuv> I've decided to use my new favourite trick of private type abbreviations to get around it. A variant with >100 constructors is an untestable mess.
<kaustuv> (in reference to a stale topic of nearly 45 minutes ago)
<mrvn> what's that?
<kaustuv> module M : sig type t = private int end = struct type t = int end
<kaustuv> M.t is coercable to an int in client code, but nothing can construct M.t except what's in M.
hkBst has quit [Read error: 110 (Connection timed out)]
tonyIII_ has quit [Read error: 60 (Operation timed out)]
willb has quit [Connection timed out]
Demitar has joined #ocaml