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
angerman has joined #ocaml
jeanbon has quit ["J'y trouve un goût d'pomme."]
angerman has quit [Client Quit]
steg_ has quit [Remote closed the connection]
steg has joined #ocaml
thelema has joined #ocaml
angerman has joined #ocaml
jamii has quit [Read error: 110 (Connection timed out)]
angerman has quit []
Ched has quit [Read error: 110 (Connection timed out)]
Ched has joined #ocaml
_andre has joined #ocaml
jeddhaberstro has quit []
Yoric[DT] has quit ["Ex-Chat"]
mwhitney has quit [Read error: 131 (Connection reset by peer)]
mwhitney has joined #ocaml
alexyk has quit []
angerman has joined #ocaml
hkBst has quit [Read error: 104 (Connection reset by peer)]
<_andre> is there a pattern for camlp4 rules that matches a (fun ...) expression?
Ched has quit [Remote closed the connection]
AxleLonghorn has joined #ocaml
AxleLonghorn has left #ocaml []
AxleLonghorn has joined #ocaml
AxleLonghorn has left #ocaml []
alexyk has joined #ocaml
AxleLonghorn has joined #ocaml
AxleLonghorn has left #ocaml []
AxleLonghorn has joined #ocaml
angerman has left #ocaml []
^authentic has joined #ocaml
authentic has quit [Read error: 110 (Connection timed out)]
^authentic is now known as authentic
jlouis has quit ["Lost terminal"]
willb has quit [Read error: 110 (Connection timed out)]
alexyk has quit []
alexyk has joined #ocaml
alexyk has quit []
_andre has quit ["Lost terminal"]
alexyk has joined #ocaml
schme has joined #ocaml
AxleLonghorn has quit [Read error: 110 (Connection timed out)]
alexyk has quit [Client Quit]
schmx has joined #ocaml
schme has quit [Nick collision from services.]
schmx is now known as schme
schme has quit ["leaving"]
mfp has quit [Read error: 110 (Connection timed out)]
mfp has joined #ocaml
kaustuv has quit [Read error: 113 (No route to host)]
m3ga has quit ["disappearing into the sunset"]
ttamttam has joined #ocaml
Yoric[DT] has joined #ocaml
<Yoric[DT]> hi
ttamttam has left #ocaml []
alexyk has joined #ocaml
Camarade_Tux has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
ttamttam has joined #ocaml
alexyk has quit []
shortc|desk has quit [Remote closed the connection]
verte has joined #ocaml
s4tan has joined #ocaml
Alpounet has joined #ocaml
mrvn has quit ["halt"]
verte has quit ["http://coyotos.org/"]
Ched has joined #ocaml
jamii has joined #ocaml
_zack has joined #ocaml
mrvn has joined #ocaml
hkBst has joined #ocaml
seafood has joined #ocaml
<Alpounet> brb
Alpounet has quit [Read error: 104 (Connection reset by peer)]
Alpounet has joined #ocaml
filp has joined #ocaml
jeanbon has joined #ocaml
Associat0r has joined #ocaml
Associat0r has quit []
jonafan_ has joined #ocaml
jonafan has quit [Read error: 110 (Connection timed out)]
chicco has quit [Remote closed the connection]
jeanbon has quit ["J'y trouve un goût d'pomme."]
kaustuv_ is now known as kaustuv
robocop has joined #ocaml
<robocop> Hello
<robocop> do you know how I search a word in s string in ocaml ? Exemple -> f "http//www.youtube.com" "youtube" send true and f "http//www.dailymotion.com" "youtube" send false
<robocop> *a string
tty56 has joined #ocaml
<robocop> mrvn: there is not a function in caml ?
<mrvn> Regexp library maybe. Not in String.
tty56 has quit []
seafood has quit []
<flx_> well, there is the Str that comes with ocaml
<flx_> but I highly recommend using ocaml-pcre instead
<mrvn> or just write a trivial search. It is not like looking for "youtube" in an url is time sensitive.
<mrvn> robocop: by the way, is f "http://a.b.c.de/this/is/not/youtube/" "youtube" true or false?
<robocop> mrvn: not important
<robocop> true is more easy.
<mrvn> You could first split the string into host, port and path components.
<robocop> Str.string_match (Str.regexp "youtube") "youtub.com" 0;;
<kaustuv> robocop: Another option is ExtString.String.find in extlib.
<robocop> thanks kaustuv.
<robocop> ha...
<robocop> why this code send me false ?
<robocop> let search = fun w s -> Str.string_match (Str.regexp w) s 0;;
<robocop> search "youtube" "http://www.youtube.com/?gl=FR&hl=fr";;
<kaustuv> obviously w doesn't start in s at position 0
<kaustuv> You want Str.search_forward
<robocop> Ha okey, thanks.
filp has quit ["Bye"]
<robocop> haha : let search = fun w s ->
<robocop> (try Str.search_forward (Str.regexp w) s 0
<robocop> with Not_found -> (-1)) <> 0 ;;
<robocop> horrible.
<robocop> *<> (-1)
Nynix has joined #ocaml
Nynix has quit [Client Quit]
<mrvn> try Str.search_forward (Str.regexp w) s 0; true with Not_found -> false
Alpounet has quit ["Ex-Chat"]
<robocop> yes, thanks, it's better mrvn.
schme has joined #ocaml
<robocop> and if I want to get "AmWvk8tuzCI" of "http://www.youtube.com/watch?v=AmWvk8tuzCI", witch function I should use ?
<robocop> (i thinks the regex is "\\?v=\\w*&?")
<kaustuv> Str.search_backward (Str.regexp w) s (String.length s - 1)
<robocop> okey, thanks.
<robocop> no, search_backward send me a int
<robocop> not a string kaustuv.
<kaustuv> then use String.sub
<robocop> not best solution ?
<kaustuv> best solution is to use $ in the regexp somewhere
<kaustuv> and use Str.match_*
<mrvn> isn't there a curl binding and doesn't it have an url parser?
<robocop> kaustuv: any exemple ? I don't find that in the documentation.
<robocop> i test this : Str.global_replace (Str.regexp "\\?v=\\w*&?") "http://www.youtube.com/watch?v=AmWvk8tuzCI" "\1";;
<robocop> but i get : Warning X: illegal backslash escape in string.
<robocop> - : string = "\\1"
<mrvn> robocop: \xyz specifies a char with interger value xyz.
<robocop> i don't understand
<kaustuv> let v_tag s =
<kaustuv> let re = Str.regexp "\\?v=\\([A-Za-z0-9]+\\)" in
<kaustuv> ignore (Str.search_forward re s 0) ; Str.matched_group 1 s
<mrvn> \000 is the same as (char_of_int 0)
<mrvn> \1 is 2 digits short.
<robocop> ha; all right
<robocop> thanks
<robocop> but Str.global_replace (Str.regexp "\\?v=\\w*&?") "http://www.youtube.com/watch?v=AmWvk8tuzCI" "\000";; send me "\000" :o
<mrvn> robocop: maybe you mean \\1
<robocop> # Str.global_replace (Str.regexp "\\?v=\\w*&?") "http://www.youtube.com/watch?v=AmWvk8tuzCI" "\\1";;
<robocop> - : string = "\\1"
<kaustuv> Use the regexp "\\(\\?v=\\w*&?\\)"
<kaustuv> Though I have no idea what you're trying to accomplish with global_replace
<robocop> what's the real function ?
Nynix has joined #ocaml
AxleLonghorn has joined #ocaml
<robocop> i'm going to use your code kaustuv, i think it's better :D
<robocop> thanks a lot for you help.
<mrvn> I just use youtube-dl.
<s4tan> hi guys, but here are differences in using ";;" or ";" to ending a phrase?
<robocop> ;; -> it's for the interpreteur
<s4tan> for example
<s4tan> let a = 3 in
<s4tan> if (a>4) then print_string "OK";
<s4tan> print_int a;;
th5 has joined #ocaml
<mfp> s4tan: a; b is roughly equivalent to let _ = a in b
<s4tan> ok, tnx mfp
<s4tan> semme that ; is used to separate expressions (from page 105 of ocaml manual ^^)
<mfp> (the difference being that in the former you'd get a warning if a cannot be of type unit)
<mfp> just think of it as a sequencing operator
<AxleLonghorn> ;; marks separate compilation units. ; is a sequencing operator like mfp just said
<s4tan> understood, tnx a lot : )
<kaustuv> Just say no to ;; (except in the toplevel)
<s4tan> right : )
<s4tan> what i realy didn't understand was why this code not work:
<s4tan> let foo =
<s4tan> let a = 12
<s4tan> and b = 13 in
<s4tan> if (a>3) then
<s4tan> if (b >10) then5;
<s4tan> ;
<s4tan> print_string "OK"
<s4tan> now i have understand :D
<s4tan> thx folks
<s4tan> just an "ignore 5" and it works
fasta has joined #ocaml
<fasta> Does OCaml have something like existential types? If so, can it inference the type for functions with these kinds of types?
<kaustuv> fasta: no existential types as such, but there is the object system that can do nearly everything existential types can
<kaustuv> however, if you use objects you give up principal typing
<fasta> kaustuv: why is that? (I read it in several places, though)
<mrvn> kaustuv: What do you mean? It still finds the right class type for you.
<kaustuv> You can encode existential types with class types, and existential types don't have principal typing because of the so-called "avoidance problem"
<kaustuv> For details, see Robert Harper's draft book on type systems (available from his web page)
<kaustuv> If you don't care about system Fw<:, you can get pretty far with open existential types (see Montagu and Remy's POPL 2009 paper)
_zack has quit [Read error: 104 (Connection reset by peer)]
_zack has joined #ocaml
robocop has quit [calvino.freenode.net irc.freenode.net]
Amorphous has quit [Connection timed out]
Amorphous has joined #ocaml
willb has joined #ocaml
Nynix has quit [Read error: 104 (Connection reset by peer)]
Associat0r has joined #ocaml
alexyk has joined #ocaml
robocop has joined #ocaml
AxleLonghorn has left #ocaml []
Snark has joined #ocaml
robocop has left #ocaml []
thelema has quit [Read error: 104 (Connection reset by peer)]
jeanbon has joined #ocaml
th5 has quit []
Yoric[DT] has joined #ocaml
Alpounet has joined #ocaml
Alpounet has quit [Read error: 104 (Connection reset by peer)]
alexyk has quit []
Yoric[DT] has quit ["Ex-Chat"]
s4tan has quit []
alexyk has joined #ocaml
fasta has quit ["Ex-Chat"]
ttamttam has left #ocaml []
Associat0r has quit []
jonafan_ is now known as jonafan
alexyk has quit []
thelema has joined #ocaml
alexyk has joined #ocaml
alexyk has quit [Client Quit]
Narrenschiff has joined #ocaml
_zack has quit ["Leaving."]
Narrenschiff has quit []
<mfp> pa_batteries is a bit evil in that it makes you go out of your way to use a top-level module with the same name as one of Batteries'
<mfp> (i.e. you have to list the other syntax extensions excluding pa_batteries and use pkg_batteries)
kaustuv_ has joined #ocaml
alexyk has joined #ocaml
<kaustuv_> has anyone ever tried calling Ocaml from Python?
alexyk has quit [Client Quit]
th5 has joined #ocaml
Camarade_Tux has quit ["Leaving"]
schme has quit ["leaving"]
OChameau has quit ["Leaving"]
schme has joined #ocaml
ttamttam has joined #ocaml
alexyk has joined #ocaml
alexyk has quit [Client Quit]
bzzbzz has quit ["leaving"]
jeddhaberstro has joined #ocaml
seafood has joined #ocaml
alexyk has joined #ocaml
alexyk has quit [Client Quit]
alexyk has joined #ocaml
Snark has quit ["Ex-Chat"]
alexyk has quit []
alexyk has joined #ocaml
jeddhaberstro has quit []
alexyk has quit []
seafood has quit []
ttamttam has left #ocaml []
Associat0r has joined #ocaml
Associat0r has quit [Read error: 54 (Connection reset by peer)]
th5 has quit []
alexyk has joined #ocaml
alexyk has quit []
alexyk has joined #ocaml
alexyk has quit [Client Quit]
Alpounet has joined #ocaml
vuln has joined #ocaml
Alpounet has quit ["Ex-Chat"]
alexyk has joined #ocaml
alexyk_ has joined #ocaml
alexyk__ has joined #ocaml
alexyk_ has quit [Read error: 104 (Connection reset by peer)]
Demitar has quit [Remote closed the connection]
alexyk has quit [Read error: 110 (Connection timed out)]
alexyk__ has quit []
alexyk has joined #ocaml
theneb has joined #ocaml
<theneb> Hi all, is there an ocaml package manager? Ie like cpan
<theneb> I'm needing to install ocaml-xml-light, downloaded and run make install but ocamlfind can't see it
<theneb> Unless I need to regenerate an index?
<mfp> theneb: is there a META file in ocaml-xml-light's source tree?
<bjorkintosh> theneb, cabal? ocaml-find?
<mfp> if you're using Debian, you can just do apt-get install libxml-light-ocaml-dev
<mfp> it's also available in GODI
alexyk has quit []
Camarade_Tux has joined #ocaml
|jedai| has quit [Read error: 110 (Connection timed out)]
<theneb> mfp: gentoo
|jedai| has joined #ocaml
<theneb> mfp: no META file
<theneb> ah right, use ocamlfind install with a META file
<mfp> then ocamlfind install META xml-light.cma xml-light.cmxa *.mli *.cmi