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
<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