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
ulfdoz_ has joined #ocaml
ulfdoz has quit [Read error: Operation timed out]
ulfdoz_ is now known as ulfdoz
letrec has joined #ocaml
srcerer has joined #ocaml
letrec has quit [Remote host closed the connection]
letrec has joined #ocaml
EmmanuelOga has joined #ocaml
Tobu has quit [Read error: Operation timed out]
Tobu has joined #ocaml
goncalo has quit [Ping timeout: 260 seconds]
goncalo has joined #ocaml
<pippijn> is there a way to get the current state and lookahead value in the menhir parser generator when it gets a parse error?
<pippijn> "parse error" is not a very nice error message
<thelema> pippijn: you can use the error token to handle most errors
<pippijn> thelema: so I need to put the error token in various locations in my grammar?
<thelema> that's what i'd do in your situation
lorilan has quit [Quit: Quitte]
Tobu has quit [Read error: Operation timed out]
Tobu has joined #ocaml
ski has joined #ocaml
Drup has quit [Quit: Leaving.]
oriba has quit [Quit: oriba]
<pippijn> thelema: I've decided to put syntax errors into the AST
<pippijn> thelema: so I can choose to ignore them or emit diagnostics, later
<pippijn> thelema: also, it allows me to report more than 1 error at a time
jave_ has joined #ocaml
lamawithonel has quit []
jave has quit [Ping timeout: 260 seconds]
Tobu has quit [Read error: Operation timed out]
emmanuelux has quit [Ping timeout: 272 seconds]
Tobu has joined #ocaml
Tobu has quit [Changing host]
Tobu has joined #ocaml
longh has quit [Ping timeout: 240 seconds]
<pippijn> I have the EOF issue with menhir
<pippijn> in error recovery, it shifts the EOF token and reads another EOF token in an infinite loop
Tobu has quit [Ping timeout: 272 seconds]
Tobu has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
<pippijn> the manual says it will warn if that is possible, but it doesn't
Tobu has joined #ocaml
Submarine has joined #ocaml
EmmanuelOga has quit [Ping timeout: 244 seconds]
avsm has joined #ocaml
fantasticsid has joined #ocaml
ocp has joined #ocaml
Snark has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
Tobu has joined #ocaml
ocp has left #ocaml []
edwin has joined #ocaml
zuymanto has joined #ocaml
ocp1 has joined #ocaml
ocp1 has quit [Client Quit]
Tobu has quit [Read error: Operation timed out]
Tobu has joined #ocaml
<adrien> good morning
eikke has joined #ocaml
Submarine has quit [Ping timeout: 244 seconds]
Submarine has joined #ocaml
twittard has joined #ocaml
<Drakken> hello adrien
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
Anarchos has joined #ocaml
antegallya has joined #ocaml
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
emmanuelux has joined #ocaml
Anarchos has quit [Read error: Connection reset by peer]
ontologiae has joined #ocaml
MaskRay has quit [Ping timeout: 260 seconds]
eikke has quit [Ping timeout: 252 seconds]
zuymanto has quit [Quit: zuymanto]
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
Tobu has quit [Ping timeout: 240 seconds]
jamii has joined #ocaml
lamawithonel has joined #ocaml
ikaros has joined #ocaml
Tobu has joined #ocaml
MaskRay has quit [Ping timeout: 260 seconds]
antegallya has quit [Quit: Leaving.]
antegallya has joined #ocaml
Submarine has quit [Ping timeout: 245 seconds]
antegallya has quit [Read error: Connection reset by peer]
antegallya has joined #ocaml
longh has joined #ocaml
jamii has quit [Ping timeout: 276 seconds]
jamii has joined #ocaml
jamii has quit [Ping timeout: 260 seconds]
lorilan has joined #ocaml
<lorilan> hello !
<adrien> o/
<matthewt> bonjourno
<lorilan> \o
Tobu has quit [Ping timeout: 260 seconds]
Tobu has joined #ocaml
<Drakken> lorilan hi
<lorilan> Drakken, hello !
<Drakken> lorilan why do you call reconrec v s k with the same value k instead of starting at 0 again? Are conditions 0 through k-1 guaranteed to be satisfied already?
<lorilan> yes they are
<lorilan> v is the current state of the state machine i'm exploring
<lorilan> and s is the string i'm matching with the machine state
<lorilan> wait
<lorilan> i rewrited it with lists
<lorilan> ha ok and to finish to answer your question
<lorilan> there are some state in my machine where i can go with no conditions
<lorilan> so i already check 0 trough k-1, but i go to the next state without progressing in my string
<Drakken> you probably don't need a list option. You can represent None by an empty list.
<lorilan> lol
<lorilan> it's the work in progress syndrom
<lorilan> first I have a first etat type witch needed arrays
<lorilan> i changed the type but i keeped unnecessarily the arrays
<lorilan> well even with arrays i could have used 0 sized arrays ...
<lorilan> don't listen to me, i'm really saying b**ls**it
<zorun> lorilan: you're working on a ε-transition automaton?
<lorilan> zorun, in fact i'm working on building an automaton from a (limited) regexp
<lorilan> zorun, and to simplify the process, yes i have ε-transition
<zorun> do you build the automaton by hand?
<zorun> or automatically from the regex?
<lorilan> automatically from the regex
<lorilan> i use ocamlyacc to produce a "my_regexp" from a regexp pattern
<lorilan> here is the my_regexp type
<Drakken> Also, you don't need both branches of the if form, so you can just write if i < String.length str then List.iter ...
<Drakken> that applies when the return value/type is ()
<lorilan> yup, i really need some sleep
Tobu has quit [Ping timeout: 272 seconds]
ontologiae has quit [Ping timeout: 244 seconds]
vivanov has joined #ocaml
<Drakken> lorilan in the iteration through etat.voisins, you're looking for any element that ultimately results in a terminal state.
wtetzner has quit [Remote host closed the connection]
<vivanov> my program eats up almost all memory (reaches 94% according to 'top' command after several hours running). what are the ways/tools to diagnose where it happens apart from code inspection?
<lorilan> Drakken, yes that's the idead
<Drakken> lorilan the function you're looking for is List.exists. It can do the iteration automatically, without exceptions.
<lorilan> Drakken, lol, another persistance of the array version
<lorilan> and also the fact that i'm don't know yet all the std library api
<Drakken> lorilan you can also write your own exists function for arrays if you want.
<Drakken> I haven't checked Batteries yet, but BatArray really should have all the functions from List that don't involve splicing operations.
<Drakken> The choice between lists and arrays should be about performance, not availability of functions.
<adrien> the availability of functions also depends on how "natural" they are for lists, arrays or ...
<Drakken> adrien that's what I mean by performance.
<lorilan> i'm more an imperative guy, so i more naturally use array
<zorun> lorilan: reading through the documentation for List, Array, etc, is helpful
<lorilan> but i seems more naturall to use list in ocaml
<adrien> I meant that the two are linked quite tightly in ocaml's stdlib
<zorun> you discover new functions that could be useful
* adrien spanks lorilan
<lorilan> zorun, it's what i'm doing right now ^^
<adrien> it's not "in ocaml", it's "for this particular task"
<Drakken> lorilan you should study all the functions in List. They're very useful.
<lorilan> Drakken, i'm realising it since yesterday ^^
<zorun> especially the fold_{left,right} functions
<zorun> you'll likeley find it difficult to understand at first, but they are really powerful :)
zuymanto has joined #ocaml
<lorilan> zorun, i've seen some example in the book i'm using to learn ocaml
<lorilan> i must admit, they are not the most easy to understand, but where I had make 10 lines for the exercice, the correction took 3 words ...
<Drakken> lorilan it takes time.
<Drakken> but it's worth it.
<adrien> # List.fold_left (+) 0 [ 1; 2; 3; 4 ];;
<adrien> - : int = 10
<adrien> you'll have to force yourself to use some of the functions until it gets in your brain
<adrien> then you'll hate ocaml for preventing you from doing some things like Java (you should be thankful :-) )
<adrien> beer-time, bye :P
<lorilan> bye !
<lorilan> thanks for the tips
<zorun> it's funny, this kind of things have been possible in Lisp for decades
<lorilan> Drakken, yes but that's exactly the problem, time is what i miss these days
<zorun> but they're becoming more and more widespread :)
<zorun> (python, C++…)
<Drakken> lorilan whatever. have fun with your programming, and learn more when you can.
<lorilan> Drakken, thks !
<lorilan> know it's prolog time !
cdidd has quit [Remote host closed the connection]
Tobu has joined #ocaml
<zuymanto> Hi
<zuymanto> How can I get the main output of a program in ocaml
<thelema> zuymanto: what do you mean by "main output"?
<thelema> your program can print whatever it wants to stdout
<zuymanto> just the stdout
<zuymanto> A print "ok" i want to get this "ok" in B bet let e = ...
<lorilan> print_string "OK" ?
<thelema> ?? you have one piece of code that prints "ok", and you want to read that "ok" in another function?
<zuymanto> like e = `./myprog` with bash
<thelema> ah. is this a single program, or necessarily two programs?
<zuymanto> i have one program which prints "ok"
<zuymanto> and in an other program i want to get that in a variable
<zorun> use "read_line"?
<zorun> and then pipe the two programs together
<thelema> Unix.open_process_in "prog2" |> ...
<zorun> like "./print_ok | ./read_ok"
<zuymanto> no this solution can be use when A and B are define and compiled
<thelema> }|> input_line
<zuymanto> read_ok need to use the output off print_ok in his code.
<zuymanto> Can i explain my problem in french ? -_-'
<thelema> let output_line1 = input_line (Unix.open_process_in "./print_ok")
<thelema> zuymanto: in #ocaml-fr
<zuymanto> Oh thank that look like what i need
<zuymanto> Ok for ocaml-fr
<zuymanto> thank
<zuymanto> thelema good job =)
Drup has joined #ocaml
<zuymanto> for my next step, i need to get an ocurl response in a variable
Tobu has quit [Ping timeout: 260 seconds]
<zuymanto> Ocurl is a library which allow http[s] connection
Drup has quit [Remote host closed the connection]
<thelema> zuymanto: I use curl in odb - code here: https://github.com/thelema/odb/blob/master/odb.ml#L80
<zuymanto> hum great
<zuymanto> perhaps this solution is too strong for my little problem
Drup has joined #ocaml
<zuymanto> if i understand your code create a temporal file to save the curl/wget request ?
<zuymanto> So I can't do that with Ocurl ? by let resp = Curl.SOMTHING uri ?
<thelema> zuymanto: you probably can - I did this to avoid any ocaml library dependencies
Tobu has joined #ocaml
<zuymanto> Ok, tout s'explique.
<zuymanto> a link to WRFPL detail please?
<zuymanto> WTFPL*
<zuymanto> Ok that good :D
letrec has quit [Ping timeout: 260 seconds]
longh has quit [Quit: Konversation terminated!]
ontologiae has joined #ocaml
iago has joined #ocaml
Anarchos has joined #ocaml
zuymanto has quit [Quit: zuymanto]
pilki has joined #ocaml
djcoin has joined #ocaml
pilki has quit [Quit: This computer has gone to sleep]
ontologiae has quit [Ping timeout: 260 seconds]
pilki has joined #ocaml
avsm has quit [Quit: Leaving.]
ontologiae has joined #ocaml
decaf has joined #ocaml
avsm has joined #ocaml
decaf has quit [Quit: Page closed]
<iZsh> how can I print a generic exception?
eikke has joined #ocaml
iago has quit [Quit: Leaving]
zuymanto has joined #ocaml
<iZsh> ok found it, Printexc.to_string
Tobu has quit [Read error: Operation timed out]
Tobu has joined #ocaml
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
Cyanure has joined #ocaml
Tobu has joined #ocaml
Tobu has quit [Changing host]
Tobu has joined #ocaml
bzzbzz has joined #ocaml
ontologiae has quit [Ping timeout: 276 seconds]
jamii has joined #ocaml
EmmanuelOga has joined #ocaml
pilki has quit [Quit: This computer has gone to sleep]
pilki has joined #ocaml
vivanov has quit [Ping timeout: 265 seconds]
vivanov has joined #ocaml
iago has joined #ocaml
antegallya has quit [Ping timeout: 245 seconds]
jamii has quit [Remote host closed the connection]
Snark has quit [Quit: Quitte]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
eikke has quit [Ping timeout: 252 seconds]
otk has joined #ocaml
pilki has quit [Quit: Leaving]
vivanov has quit [Quit: Lost terminal]
otk_ has quit [Ping timeout: 260 seconds]
eikke has joined #ocaml
fraggle_laptop has joined #ocaml
ontologiae has joined #ocaml
antegallya has joined #ocaml
eikke has quit [Ping timeout: 245 seconds]
ikaros has quit [Quit: Ex-Chat]
pilki has joined #ocaml
fraggle_laptop has quit [Remote host closed the connection]
Cyanure has quit [Quit: Quitte]
Tobu has quit [Ping timeout: 272 seconds]
ontologiae has quit [Quit: leaving]
edwin has quit [Remote host closed the connection]
zuymanto has quit [Quit: zuymanto]
letrec has joined #ocaml
<ulfdoz> /gone
<ulfdoz> (/gone
<ulfdoz> arg, sry
<djcoin> :)
Tobu has joined #ocaml
pilki has quit [Quit: This computer has gone to sleep]
Tobu has quit [Ping timeout: 260 seconds]
lorilan has left #ocaml []
zorun has quit [Read error: Connection reset by peer]
zorun has joined #ocaml
letrec has quit [Ping timeout: 260 seconds]
Drup has quit [Quit: Leaving.]
avsm has quit [Quit: Leaving.]