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