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
smerz has quit [Remote host closed the connection]
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
pilki has joined #ocaml
fantasticsid has joined #ocaml
dsheets has quit [Ping timeout: 240 seconds]
dsheets has joined #ocaml
pilki has quit [Quit: This computer has gone to sleep]
philtor 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
pilki has joined #ocaml
pilki has quit [Client Quit]
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
ankit9 has quit [Ping timeout: 240 seconds]
ankit9 has joined #ocaml
sebz has joined #ocaml
sebz has quit [Client Quit]
sebz has joined #ocaml
spearalot has joined #ocaml
spearalot has quit [Quit: Computer has gone to sleep]
ankit9 has quit [Quit: Leaving]
thelema_ has quit [Remote host closed the connection]
thelema has joined #ocaml
philtor has quit [Ping timeout: 252 seconds]
vivanov has joined #ocaml
<vivanov> pls suggest some library to schedule tasks in time
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
<vivanov> smth like cron
<_habnabit> why not... use cron?
kmc has quit [Quit: Leaving]
sebz has quit [Quit: Computer has gone to sleep.]
probst_ has joined #ocaml
probst has quit [Read error: Connection reset by peer]
probst_ is now known as probst
abdallah has joined #ocaml
Kakadu has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
Snark has joined #ocaml
ankit9 has joined #ocaml
cago has joined #ocaml
ftrvxmtrx has joined #ocaml
ikaros has joined #ocaml
destrius has quit [Read error: Connection reset by peer]
destrius has joined #ocaml
abdallah has quit [Quit: Ex-Chat]
milosn has joined #ocaml
BiDOrD_ has joined #ocaml
BiDOrD has quit [Ping timeout: 252 seconds]
Cyanure has joined #ocaml
emmanuelux has joined #ocaml
sgnb has joined #ocaml
edwin has joined #ocaml
ocp has joined #ocaml
<vivanov> _habnabit: i wanted smth inside ocaml code -- thx anyway
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
Submarine has joined #ocaml
_andre has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
destrius has quit [Quit: Leaving.]
emmanuelux has joined #ocaml
hnrgrgr has quit [Remote host closed the connection]
Snark has quit [Quit: Quitte]
pilki has joined #ocaml
ikaros has quit [Quit: Ex-Chat]
ikaros has joined #ocaml
<hcarty> vivanov: You could hack something together with the Calendar module plus some sort of loop
<adrien> posix signals! (evil :-) )
pilki has quit [Quit: This computer has gone to sleep]
<adrien> or lwt_timeout
<hcarty> adrien: Yes, I wouldn't be surprised if Lwt could match this rather closely
<hcarty> It seems to do everything else :-)
<adrien> but takes an int
<adrien> no idea how far the timeout can be
<adrien> (afk)
ankit9 has quit [Quit: Leaving]
fantasticsid has quit [Ping timeout: 252 seconds]
fantasticsid has joined #ocaml
fantasticsid has quit [Client Quit]
<hcarty> It looks like Lwt_stream could do this as long as the input function was properly written
fantasticsid has joined #ocaml
fantasticsid has quit [Client Quit]
sebz has joined #ocaml
lamawithonel_ has joined #ocaml
fantasticsid has joined #ocaml
lamawithonel has quit [Ping timeout: 240 seconds]
oriba has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
sebz has quit [Client Quit]
mlasson has joined #ocaml
<mlasson> hello
<mlasson> I don't understand why the following ocamlyacc file compile without any warning : http://pastebin.com/x2g7Ckzh
<mlasson> Even with one operator it should warn me about the conflict for 2+2+2 (since I've declared + to be nonassoc)
<thelema> mlasson: are you missing a paren on L20?
<thelema> mlasson: priority is given by order of rules
<thelema> but that's not your problem, I think... you want a warning about what?
<mlasson> yes there is a missing parenthesis in the caml code :)
<mlasson> I want a warning or an error from the generated parser when I provide : 2+2+2
<mlasson> I mean, either a warning from the parser generator, or a clear behavior for the generated parser (like an error)
<thelema> mlasson: ok, file a bug at mantis
<thelema> mlasson: you're right that this is something that ocamlyacc could/should do
<mlasson> I just wanted to be sure I was not misunderstanding something about the keyword "nonassoc"
<thelema> nope. I think it's accepted for compatibility in ocaml, but that since most uses of a non-associative operator involve the result of the operation having a different type than the operands, this kind of problem is caught by the type system rather than by the parser generator
<thelema> hmm, according to the documentation, this should work, so you've seemingly found a bug
<thelema> and by work, I mean that a syntax error should be raised.
<thelema> "If the token is non-associative, then the parser will declare a syntax error. "
<thelema> gildor: any chance of fixing either 1) odn's setup.ml file so it doesn't check test deps on -configure or 2) the dep list on oasis-db's odb info files so they include test dependencies?
jamii has joined #ocaml
letrec has joined #ocaml
iago has joined #ocaml
milosn_ has joined #ocaml
hnrgrgr has joined #ocaml
milosn has quit [Ping timeout: 268 seconds]
<mlasson> I've filled the report. Thank you.
<thelema> thank you for the report
<mlasson> goodbye
mlasson has quit [Quit: leaving]
mcclurmc has quit [Excess Flood]
mcclurmc has joined #ocaml
jamii has quit [Ping timeout: 252 seconds]
jamii has joined #ocaml
letrec has quit [Remote host closed the connection]
letrec has joined #ocaml
agarwal1975 has joined #ocaml
kerneis_ has joined #ocaml
sebz has joined #ocaml
kerneis_ has quit [Client Quit]
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
Cyanure has quit [Read error: Operation timed out]
technomancy has quit [Ping timeout: 240 seconds]
ocp has quit [Ping timeout: 240 seconds]
raichoo has joined #ocaml
raichoo has quit [Client Quit]
<oriba> if I get an Out_of_memory-exception (using Num/Big_int module), how to circumvent this problem?+
<thelema> oriba: really? That's odd. Can you try zarith instead of num/big_int?
raichoo has joined #ocaml
cago has quit [Quit: Leaving.]
avsm has joined #ocaml
<oriba> thelema, what is zarith?
<oriba> sgnb, thank you
avsm has quit [Quit: Leaving.]
letrec has quit [Ping timeout: 252 seconds]
g0dmoney- has quit [Quit: bbl]
ulfdoz has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
spearalot has joined #ocaml
technoma- has joined #ocaml
technoma- is now known as technomancy
fraggle_laptop has joined #ocaml
ttamttam has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
Cyanure has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
iago has quit [Ping timeout: 260 seconds]
avsm has joined #ocaml
<NaCl> what's the best way to break out of an iterative loop?
<NaCl> rather, what is considered to be the best way
<thelema> NaCl: BatReturm
<thelema> *Return
<NaCl> wonderful
<thelema> or if you don't mind getting a bit less high-level, just throw and catch an exception.
* NaCl should install that later
<NaCl> kk, thanks
<adrien> we should sbo batteries and a few other libs
<thelema> sbo?
<adrien> slackbuilds.org: collection/repo of slackbuilds which are scripts to create slackware packages
<thelema> adrien: let me know if you need anything from me
<adrien> thelema: if it builds and installs nicely with oasis/ocamlfind, everything should be good =)
<thelema> that it does.
lopex has quit [Remote host closed the connection]
joewilliams has quit [Remote host closed the connection]
bobry has quit [Remote host closed the connection]
kmc has joined #ocaml
joewilliams has joined #ocaml
technomancy has quit [Disconnected by services]
technomancy_ has joined #ocaml
_andre has quit [Quit: leaving]
lopex has joined #ocaml
bobry has joined #ocaml
BiDOrD has joined #ocaml
BiDOrD_ has quit [Ping timeout: 260 seconds]
Kakadu has quit [Read error: No route to host]
Kakadu has joined #ocaml
ftrvxmtrx has joined #ocaml
NihilistDandy has quit [Ping timeout: 240 seconds]
sebz has joined #ocaml
sebz has quit [Client Quit]
ttamttam has quit [Quit: ttamttam]
avsm has quit [Quit: Leaving.]
spearalot has quit [Quit: Get MacIrssi - http://www.sysctl.co.uk/projects/macirssi/]
sebz has joined #ocaml
ikaros has quit [Quit: Ex-Chat]
<maufred> Hello, I have a doubt, is this hypothetical function tail-rec or not ? http://pastebin.com/6Tx3eLqP
<thelema> maufred: yes
<maufred> ah thx !
<thelema> although technically, it's not the function that's tail rec, but the rec call
<thelema> each call from a function to itself can be tail recursive or not.
<adrien> and why the reference? some kind of accumulator to store the data that has alreaday been processed?
<maufred> yes the code is only a very simplification of mine
<adrien> you could do it "better" with an additional function parameter once you're more comfortable with what you already have
<thelema> if the return value of that function call is the return value of the whole function, that call is in a "tail" position, and you get tail-recursion (except inside exception handlers)
<maufred> thelema: I'm note sure to understand the diffrence between tail rec and rec call
<maufred> adrien: you pointing the use of an accumulator, right ?
<thelema> maufred: tail recursion is the result of tail calls
<maufred> thelema: ah OK
<maufred> may I bother you 2 min more for another question
<thelema> if your function's recursive calls are all tail recursive, your function uses fixed stack space
<adrien> maufred: yes, accumulators
<thelema> it's possible to have some calls be tail recursive (in which the stack won't grow) and others not tail recursive (which will grow the stack)
<adrien> (now I'm wondering if we couldn't have a simple heuristic script to check tail-recursivity; something dirty but not meant to be perfect)
<maufred> My doubt was because I do a if-then-else and call the function in each, so I was wondering if it's still tail-rec (or rec call)
<thelema> maufred: the key is whether every time you call the function that nothing happens after it returns.
<thelema> (within itself)
<maufred> ah OK, it's more clear like this
<thelema> so the if/then doesn't matter
sebz has quit [Quit: Computer has gone to sleep.]
<thelema> just whether there's any more work for this instance of the function to do after calling itself
<maufred> my second question then is "is doing a lot (100 000) a try List.assoc on a list of length around 5000 is slow" ? (in my case it is
<thelema> yes. Maybe use Map
<thelema> or Hashtbl
ikaros has joined #ocaml
<maufred> speaking of hashtbl, could you tell me when to choose a hashtbl over a map ?
<thelema> maufred: for ocaml, use hashtbl when you want a mutable data structure and maps when you want a functional data structure
milosn has joined #ocaml
<maufred> thelema: OK, thank you very much for your quick and perfect answers !
<thelema> maufred: also, be careful of using hashtbl on complex values
milosn_ has quit [Ping timeout: 252 seconds]
<thelema> the builtin hash function will result in very bad performance for complex values (not-tiny lists, etc.)
<thelema> maufred: you're welcome, enjoy ocaml
<maufred> thelema: your explanation confirmed why previously I had to swich from hashtbl to map. Thank you very much !
<thelema> maufred: this bug is fixed in the next version of ocaml, Hashtbl will be happier then
ftrvxmtrx has quit [Quit: Leaving]
<maufred> thelema: good to know, but as a basic user, I'm not sure I can use all the improvements ;)
<thelema> I haven't figured out the GADT stuff that's also coming in 3.13
Anarchos has joined #ocaml
technomancy_ is now known as technomancy
Cyanure has quit [Remote host closed the connection]
fraggle_laptop has quit [Ping timeout: 244 seconds]
Snark has joined #ocaml
Snark has quit [Remote host closed the connection]
iago has joined #ocaml
Submarine has quit [Ping timeout: 255 seconds]
Anarchos has quit [Ping timeout: 240 seconds]
Kakadu has quit [Ping timeout: 252 seconds]
avsm has joined #ocaml
Anarchos has joined #ocaml
sgnb` has joined #ocaml
arpd has joined #ocaml
sgnb has quit [Ping timeout: 252 seconds]
arpd has quit [Client Quit]
jamii has quit [Ping timeout: 252 seconds]
oriba has quit [Quit: oriba]
jamii has joined #ocaml
sebz has joined #ocaml
ikaros has quit [Quit: Ex-Chat]
avsm has quit [Quit: Leaving.]
edwin has quit [Remote host closed the connection]
emmanuelux has quit [Quit: Bye]
emmanuelux has joined #ocaml
jamii has quit [Read error: Operation timed out]
jamii has joined #ocaml
sgnb` is now known as sgnb
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
agarwal1975 has joined #ocaml
jamii has quit [Ping timeout: 240 seconds]
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
hcarty has quit [Ping timeout: 255 seconds]
hcarty has joined #ocaml
letrec has joined #ocaml
milosn has quit [Ping timeout: 252 seconds]
Morphous_ has quit [Read error: Operation timed out]
agarwal1975 has quit [Quit: agarwal1975]
maufred has quit [Ping timeout: 252 seconds]
Morphous_ has joined #ocaml
NihilistDandy has joined #ocaml
<dsheets> if i catch an exception, bundle it and later re-raise it, its stack trace is overwritten. can i capture the old trace?
<adrien> you can see the Printexc module
<_habnabit> dsheets, 'bundle' it?
<adrien> also, it should rather mention that the exception has been "re-raised"
letrec has quit [Ping timeout: 260 seconds]
<_habnabit> dsheets, fwiw I can't reproduce your issue, but I don't know what you mean by 'bundle'
<adrien> try raise_f with e -> raise e
<adrien> that should work
<_habnabit> it 'works' that way too
<_habnabit> I mean, the way I already have it
<adrien> with raise directly it will more likely keep the trace
<_habnabit> what part of this is decided based on probability ??
<dsheets> 'bundle' = collect in a data structure
<adrien> and if you have a bigger code to do, like something between your "in" and "raise", I'd rather use "with e -> bunch of code; raise e"
<adrien> rather than let exc and reuse the exception later on
<adrien> _habnabit: the probability part is that stacktraces aren't 100% perfect
<adrien> dsheets: Printexc
<dsheets> i have a super-exception that contains a variant tag and a list of exceptions
<_habnabit> dsheets, you're going to have to be much more specific about what you think the problem is
<adrien> obviously, if you're catching the exception, storing it somewhere, moving in the code and doing something new with it, you'll have lost your stack and it wouldn't mean anything in the new context anyway
<_habnabit> well, sure, but it can still be useful to know what the stack /was/
<adrien> val get_backtrace : unit -> string
<adrien> Printexc.get_backtrace () returns a string containing the same excep‐
<adrien> tion backtrace that Printexc.print_backtrace would print.
<adrien> and
<adrien> val print_backtrace : Pervasives.out_channel -> unit
<adrien> Printexc.print_backtrace oc prints an exception backtrace on the output
<adrien> channel oc . The backtrace lists the program locations where the
<adrien> most-recently raised exception was raised and where it was propagated
<adrien> through function calls.
<dsheets> yes, i am reading Printexc now, thanks for the tip
<adrien> as you'll see, most of the stuff is from 3.11.0 and on
<dsheets> i will explicit propagate traces with Printexc. Thanks adrien, _habnabit
<_habnabit> oh hey I didn't know about Printexc.register_printer
<_habnabit> this will be useful in my own code
<_habnabit> hmmm, maybe I'm not using it correctly
<_habnabit> or is it not called when ocaml exits due to an unhandled exception?
pilki has joined #ocaml
pilki has quit [Client Quit]
destrius has joined #ocaml
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 260 seconds]
ulfdoz_ is now known as ulfdoz
iago has quit [Quit: Leaving]