gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
arubin has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
sebz has joined #ocaml
emmanuelux has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
ikaros has quit [Quit: Ex-Chat]
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
dgbaley27 has joined #ocaml
dgbaley27 has left #ocaml []
dgbaley27 has joined #ocaml
<dgbaley27> Is there a way to dynamically set a module? So something like "module Ast = if true Astv0 else Astv1"
<thelema> dgbaley27: in ocaml 3.12, first class modules can be treated like that.
<thelema> I'm not sure about the syntax, there's something about packing and then unpacking the module that you'll probably need to do
<dgbaley27> Ok, well, that's my version, so thank you
oriba_ has quit [Quit: oriba_]
dgbaley27 has left #ocaml []
dsheets has quit [Ping timeout: 244 seconds]
dsheets has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
destrius has quit [Ping timeout: 268 seconds]
emmanuelux has joined #ocaml
everyonemines has joined #ocaml
destrius has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
g0dmoney- has quit [Ping timeout: 252 seconds]
g0dmoney- has joined #ocaml
g0dmoney- has quit [Changing host]
g0dmoney- has joined #ocaml
emmanuelux has joined #ocaml
everyonemines has quit [Remote host closed the connection]
everyonemines has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
linshuai_irc has joined #ocaml
everyonemines has quit [Quit: Leaving.]
<linshuai_irc> Hello guys, anyone knonws where to find tutorials on using Camomile Library ?
emmanuelux has quit [Remote host closed the connection]
<linshuai_irc> I want to do some work on handling some UTF-8 encoded documents
emmanuelux has joined #ocaml
lamawithonel_ has quit [Ping timeout: 240 seconds]
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
<linshuai_irc> any suggestions?
<linshuai_irc> /?
<linshuai_irc> /#
ulfdoz has joined #ocaml
arubin has quit [Quit: arubin]
<_habnabit> linshuai_irc, google.com
<companion_cube> this website is nice, is it a startup?
reynir has joined #ocaml
ftrvxmtrx has joined #ocaml
reynir has quit [Quit: leaving]
ulfdoz has quit [Ping timeout: 248 seconds]
jonafan has quit [Read error: Operation timed out]
jonafan has joined #ocaml
<linshuai_irc> I've done quite a lot of google-ing, but get few helpful results
larhat has joined #ocaml
ttamttam has joined #ocaml
ftrvxmtrx_ has joined #ocaml
edwin has joined #ocaml
linshuai_irc has quit [Remote host closed the connection]
larhat1 has joined #ocaml
larhat has quit [Read error: Connection reset by peer]
raichoo has joined #ocaml
ygrek has joined #ocaml
sebz has joined #ocaml
ankit9 has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
struktured has quit [Ping timeout: 240 seconds]
sebz_ has joined #ocaml
ygrek has quit [Ping timeout: 248 seconds]
<emias> p
rixed_AFK is now known as rixed
ankit9 has quit [Ping timeout: 252 seconds]
ankit9 has joined #ocaml
sebz_ has quit [Quit: Computer has gone to sleep.]
eikke has joined #ocaml
ankit9 has quit [Ping timeout: 240 seconds]
destrius has quit [Quit: Leaving.]
ttamttam` has joined #ocaml
ttamttam` has quit [Remote host closed the connection]
struktured has joined #ocaml
<flux> thelema, btw, mantis works again without authentication, must've been a glitch
struktured has quit [Read error: Connection reset by peer]
struktured has joined #ocaml
sebz has joined #ocaml
Cyanure has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
sebz has quit [Ping timeout: 240 seconds]
<benoit_> exit
benoit_ has quit [Quit: Lost terminal]
ttamttam has quit [Remote host closed the connection]
avsm has joined #ocaml
raichoo has quit [Read error: Connection reset by peer]
Cyanure has quit [Remote host closed the connection]
raichoo has joined #ocaml
<maufred> Does anyone know if stdout is considered as a regular file or not ? seek_out always gets me erros
<adrien> you can't seek there, it's a general rule
Drakken has joined #ocaml
<adrien> ESPIPE fd is associated with a pipe, socket, or FIFO.
<adrien> On Linux, using lseek() on a tty device returns ESPIPE.
<adrien> for instance
<adrien> and as you can guess, there is no reason to consider stdout as a regular file
<maufred> yes, just like I thought. Thx !
<adrien> np
ftrvxmtrx_ has quit [Ping timeout: 244 seconds]
<flux> you can seek it, if it's a file
ftrvxmtrx_ has joined #ocaml
ikaros has joined #ocaml
sgnb` has joined #ocaml
lamawithonel has joined #ocaml
sgnb has quit [Remote host closed the connection]
LittleEndian` has joined #ocaml
<LittleEndian`> Hey
mcclurmc has quit [Excess Flood]
mcclurmc has joined #ocaml
<adrien> flux: right, but if your program _needs_ to be able to seek in its output, it's better not to use stdout for that
svenl has quit [Ping timeout: 240 seconds]
ftrvxmtrx_ has quit [Ping timeout: 248 seconds]
emmanuelux has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
ftrvxmtrx_ has joined #ocaml
DreamCatcher has joined #ocaml
<DreamCatcher> ocamlfind: Package `stdext' not found - no one knows how to overcome
emmanuelux has joined #ocaml
ttamttam has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
zorun has quit [Read error: Connection reset by peer]
zorun has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
emmanuelux has quit [Read error: Connection reset by peer]
ygrek has joined #ocaml
emmanuelux has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
ankit9 has joined #ocaml
avsm has quit [Quit: Leaving.]
<jonludlam> DreamCatcher - what are you trying to compile?
avsm has joined #ocaml
<DreamCatcher> jonludlam, xen-xapi
avsm has quit [Client Quit]
<jonludlam> DreamCatcher: OK, if you've got libxcp-ocaml-dev installed, you'll need to export OCAMLPATH=/usr/lib/ocaml/xcp before compiling
<jonludlam> Actually, are you trying to compile on debian/ubuntu or centos?
<DreamCatcher> thanks, compile on gentoo and openindiana
<jonludlam> ah. outside of my experience I'm afraid. However, the error you're getting sounds like you've not got xen-api-libs installed
<jonludlam> Best place to get help on that it #xen-api
<DreamCatcher> ok, thanks
Snark has joined #ocaml
<thelema> flux: actually, I reported the bug on -devl and the admin fixed it.
ygrek has quit [Ping timeout: 248 seconds]
rbancroft has quit [Ping timeout: 255 seconds]
ankit9 has quit [Ping timeout: 244 seconds]
rbancroft has joined #ocaml
Cyanure has joined #ocaml
scrappy_doo_ has joined #ocaml
Drakken has quit [Ping timeout: 248 seconds]
ttamttam has quit [Remote host closed the connection]
avsm has joined #ocaml
ulfdoz has joined #ocaml
LittleEndian` has quit [Quit: WeeChat 0.3.5]
raichoo has quit [Quit: leaving]
ankit9 has joined #ocaml
ttamttam has joined #ocaml
struktured has quit [Quit: Konversation terminated!]
struktured has joined #ocaml
DreamCatcher has quit [Ping timeout: 244 seconds]
ankit9 has quit [Ping timeout: 240 seconds]
fraggle_laptop has joined #ocaml
Kakadu has joined #ocaml
struktured has quit [Ping timeout: 252 seconds]
bwright has quit [Ping timeout: 252 seconds]
<hcarty> Any suggestions on a function like this: val with_first : ('a -> 'b) -> 'a list -> 'b
<thelema> ?
<hcarty> Used as: with_first int_of_string ["a"; "b"; "c"; "1"] --> 1
<thelema> ah. exceptions.
<hcarty> Yes
<thelema> hmm, I don't immediately see a pretty way to implement that with batteries functions.
<hcarty> with_first f l calls f with each element in l, returning the resulting value from the first call that doesn't raise an exception.
<thelema> I imagine something monadic with batresult could work...
<hcarty> I have an implementation with BatResult
<hcarty> Not the prettiest. And if no suitable value is found, raising the last raised exception may not be appropriate.
<thelema> let with_first f l = List.enum l |> map (Result.catch f) |> Enum.find Option.is_some |> Option.get
<thelema> raises Not_found if all fail
<hcarty> It's missing a cast from Restult -> Option, but it looks workable beyond that
<hcarty> s/Restult/Result/
<hcarty> map (Result.catch f |- Result.to_option)
<thelema> sure.
<thelema> maybe a Result.catch_option would be useful
<thelema> or the corresponding option functions on Result.t
<_habnabit> Enum.filter_map identity |> Enum.get
sepp2k has joined #ocaml
<thelema> _habnabit: wouldn't that raise the first exception from f?
<thelema> oh, n/m
<_habnabit> no, I mean after the ... okay
<thelema> nice.
<thelema> although it would compute more than necessary.
<thelema> or not, since enum is lazy...
bwright has joined #ocaml
<hcarty> That would return an option result, so it would come down to wanting 'a option or 'a
<thelema> hcarty: no, filter_map unpacks the options
<hcarty> thelema: Enum.get
<hcarty> return 'a option
<thelema> oh. silly me.
<thelema> why don't we have an Enum.get_exn?
<hcarty> I've wondered the same :-) Although apparently not enough to file a patch or bug report...
<thelema> if only some brave soul would do so, we could be rescued from the tyrrany of the batteries maintainer... :)
<hcarty> Down with Batteries! Long live Batteries AAA'!
<thelema> lol
eikke has quit [Ping timeout: 244 seconds]
rby has quit [Quit: Lost terminal]
yezariaely has joined #ocaml
LittleEndian has joined #ocaml
LittleEndian is now known as BigEndian
BigEndian has left #ocaml []
CamelBack has joined #ocaml
<CamelBack> hey all / bonsoir
oriba has joined #ocaml
<CamelBack> may i speak french here ? i have a problem with arrays bidimentionals and 2 loop
sepp2k has quit [Ping timeout: 240 seconds]
<CamelBack> Je souhaiterais ajouter l'entier 1 à tous les éléments d'un tableau, en utilisant 2 boucles FOR imbriquées (car mon objectif quand cela marchera sera de tester la validité d'un sudoku)
<CamelBack> j'ai essayé cela : http://pastebin.com/w0YtKTry
<CamelBack> le meme algo fonctionne avec un int Array, mais pas avec un int Array Array
<CamelBack> i will try to say it in english too ;)
jonludlam_home has quit [Remote host closed the connection]
<Kakadu> Ohhh, translate.ru is cool
<thelema> CamelBack: the problem is line 8
<companion_cube> don't ask to ask, just ask
<CamelBack> i woud like to add the integer (1) to all elements in a matrix, with 2 loops (when it will work my goal is to make an sudoku validity tester)
<thelema> CamelBack: Array.init 3 (fun _ -> Array.Make 3 0)
<thelema> err, Array.make 3 0 (lwoercase m)
<thelema> CamelBack: your outer array has three pointers to the same inner array
<CamelBack> omg !
<CamelBack> thanks you ;)
larhat1 has quit [Quit: Leaving.]
avsm has quit [Quit: Leaving.]
sepp2k has joined #ocaml
<thelema> CamelBack: Array.init 3 (fun i -> Array.init 3 (fun j -> t.(i).(j) + 1))
<CamelBack> your proposition work fine, i dont understand why you say its better with 2 fun intricated
<CamelBack> this work fine : let out = Array.init 3 (fun _ -> Array.make 3 0) in
<CamelBack> i understand
<CamelBack> is for to create an int array array with 2 coordonates, and insert inside ( 2;3;4 ); (5;6;7) ...
<thelema> yes, you can directly build the result array without the nested loops
<CamelBack> i understand
<CamelBack> but i made a simple exemple because i cannot start with testing sudoku grid ;)
<CamelBack> but with your help, i have solve my problem and my function to test if there 1 and 1 time only an numbers include (1 to 9) each collumn and line, work, thanks thelema ;)
fraggle_laptop has quit [Read error: Connection reset by peer]
Xizor has joined #ocaml
ttamttam has quit [Remote host closed the connection]
g0dmoney- has quit [Ping timeout: 255 seconds]
g0dmoney- has joined #ocaml
raichoo has joined #ocaml
jonludlam has quit [Ping timeout: 244 seconds]
Anarchos has joined #ocaml
yezariaely has quit [Quit: Leaving.]
jonludlam has joined #ocaml
CamelBack has quit [Quit: WeeChat 0.3.5]
sebz has joined #ocaml
milosn_ has quit [Read error: Connection reset by peer]
g0dmoney- has quit [Changing host]
g0dmoney- has joined #ocaml
albacker has joined #ocaml
milosn has joined #ocaml
raichoo has quit [Quit: Lost terminal]
Cyanure has quit [Ping timeout: 244 seconds]
Cyanure has joined #ocaml
<NaCl> adrien: was there a Pcre slackbuild lying around?
sebz has quit [Quit: Computer has gone to sleep.]
Snark has quit [Quit: Quitte]
andreypopp has joined #ocaml
Kakadu has quit [Quit: Konversation terminated!]
flapjackery has joined #ocaml
<rbancroft> 
<rbancroft> egads, sorry!
eikke has joined #ocaml
flapjackery has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
eikke has quit [Ping timeout: 252 seconds]
edwin has quit [Remote host closed the connection]
dgbaley27 has joined #ocaml
<dgbaley27> I've got a parser.mly that I'm using from someone else. When I user Parser, there are errors if the .mli exists. If I remove it, everything is fine. This has been ok for now using make because I just rm it manually after calling ocamlyacc. But I want to give ocamlbuild a try. Is there a way to automatically remove it or not generate using ocamlyacc/ocamlbuild
sebz has joined #ocaml
andreypopp has quit [Quit: Leaving.]
sepp2k has quit [Remote host closed the connection]
Xizor has quit []
Morphous has quit [Ping timeout: 240 seconds]
bwright has quit [Ping timeout: 240 seconds]
Morphous has joined #ocaml
bwright has joined #ocaml
roha has joined #ocaml
Cyanure has quit [Remote host closed the connection]
<oriba> dgbaley27, you could just rm *.mli before compilation...?!
<oriba> or... not *.mli but the yacc stuff
<dgbaley27> But if I use ocamlbuild main.native, for example, it will automatically do everything, there's no hook for me to remove the parser.mli between the correct steps
<oriba> hmhh I don't use ocamlbuild
<_habnabit> dgbaley27, are you writing a .mli file? where is it coming from
<oriba> with OCamlMakefile, if make fails, I would do make clean && make
<oriba> ocamlyacc
<_habnabit> dgbaley27, I don't know what you're doing, because ocamlyacc + ocamlbuild has never given me issues before
eikke has joined #ocaml
<dgbaley27> ocamlyacc generates .ml and .mli from .mly
<_habnabit> yes.
<dgbaley27> So I'm including the Parse module from this project: https://github.com/m2ym/ocaml-lang-python
<dgbaley27> The error has something to do with A.modl and A.expr in parser.mly
<_habnabit> so, you kind of need to show us /the actual error/ and what you're doing to get it
dnolen has joined #ocaml
<dgbaley27> File "parser.mli", line 89, characters 48-56:
<dgbaley27> Error: Unbound type constructor modl
<dgbaley27> i'll pastebin a test main I wrote for it, one moment
<dgbaley27> Actually, that's not important, it was just a hello, world that didn't even use the parser. if I try to do "ocamlopt parser.mli" i get that error. If I try to use the parser module while the mli exists, it complains the there is no .cmi. If I just remove the .mli, I can use the parser module without a problem.
<_habnabit> why are you running ocamlopt?
<dgbaley27> ocamlc, it doesn't matter
<_habnabit> why are you running /either/? you said you were using ocamlbuild
<dgbaley27> I'm breaking down the step that fails.
<dgbaley27> It's just a wrapper is it not?
<_habnabit> okay, do `ocamlbuild -clean` and then `ocamlbuild -verbose 2 hello.byte` or whatever your .ml file is named
<_habnabit> pastebin the output in your terminal and the contents of _build/_log
roha has quit [Ping timeout: 244 seconds]
roha has joined #ocaml
<dgbaley27> yes
<dgbaley27> i'll be back in 10 minutes. thank you so far!
<_habnabit> and did you copy ast.ml as well?
<_habnabit> I don't see any mention of ast.ml in your _log
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
Anarchos has joined #ocaml
Anarchos has quit [Client Quit]
albacker has quit [Quit: Leaving]
ikaros has quit [Quit: Ex-Chat]
<dgbaley27> _habnabit: I cloned the whole repo
dnolen has quit [Quit: dnolen]
oriba_ has joined #ocaml
Anarchos has joined #ocaml
Anarchos has quit [Client Quit]
oriba has quit [Ping timeout: 240 seconds]
sebz has quit [Quit: Computer has gone to sleep.]
roha has quit [Ping timeout: 240 seconds]
roha has joined #ocaml
eikke has quit [Ping timeout: 252 seconds]
<adrien> NaCl: pcre, I don't think so
<NaCl> adrien: and is there an argparse that will take GNU-style long arguments?
<_habnabit> you can do --foo with Arg
<NaCl> Ain't that old or something
<adrien> but there are really a number of different modules for argument parsing
<NaCl> Seems like the way to have -w mapped to --whatever would be to do it twice
<NaCl> blah, blah, not unified, blah, blah...
<NaCl> reminds me of the perl argparses
<adrien> hmmmm, no idea, I'm only up because I need to massage my legs to avoid night cramps
<NaCl> adrien: I was looking at something like python's argparse
<NaCl> s/at/for
<adrien> you know I try to stay away from python ;-)
<NaCl> I mean, to make one like it.
<NaCl> Except for ocaml.
<NaCl> And I can't not avoid python at work, nobody else knows it
<NaCl> it = ocaml
<adrien> NaCl: I think I should stop rendering new flames: http://notk.org/~adrien/hq/ :P
<adrien> (I HATE FIREFOX)
<adrien> I've actually started to wonder if the only right way to parse arguments was to make an actual parser
<adrien> a full-blown one
<adrien> in which case, I'm not sure you could make a library
<NaCl> adrien: yes, you shoul;d
<adrien> but if you are after a library, before making your own, there is close to half a dozen libraries to check
<NaCl> EAGLES
<adrien> flames are the new Rorschach tests ;-)
<NaCl> theres one in batteries