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