sword865 has quit [Quit: Connection closed for inactivity]
catonano has quit [Quit: catonano]
mzan has quit [Quit: Leaving]
ziyourenxiang has quit [Quit: Leaving]
ziyourenxiang has joined #racket
cantstanya has quit [Ping timeout: 240 seconds]
wingsorc has joined #racket
cantstanya has joined #racket
orivej has quit [Ping timeout: 268 seconds]
ziyourenxiang has quit [Ping timeout: 240 seconds]
badkins has joined #racket
endobson has joined #racket
vraid has quit [Quit: Leaving]
aidalgol has quit [Ping timeout: 240 seconds]
mzan has joined #racket
pilne has joined #racket
FreeFull has joined #racket
vraid has joined #racket
sleepnap has joined #racket
aidalgol has joined #racket
Lowl3v3l has joined #racket
sauvin has quit [Ping timeout: 265 seconds]
badkins has quit [Remote host closed the connection]
badkins has joined #racket
badkins has quit [Ping timeout: 240 seconds]
endobson has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sleepnap has left #racket [#racket]
Codaraxis has quit [Ping timeout: 265 seconds]
<samth>
greghendershott: is eldoc somehow unable to use the information provided by racket-describe?
aidalgol has quit [Write error: Connection reset by peer]
badkins has joined #racket
efm has quit [Quit: Konversation terminated!]
camelCaser has quit [Ping timeout: 258 seconds]
camelCaser has joined #racket
Codaraxis has joined #racket
Codaraxis has quit [Remote host closed the connection]
Codaraxis has joined #racket
acummings has quit [Ping timeout: 258 seconds]
badkins has quit [Remote host closed the connection]
narimiran has quit [Ping timeout: 260 seconds]
badkins has joined #racket
eigenlicht has joined #racket
<eigenlicht>
How to limit maximum recursion depth?
<dzoe>
samth: thanks for the merge - but now it keeps me wondering whether flonums and extflonums documentation shouldn't state roughly the same ...
<samth>
dzoe: i'm skeptical that the approach described in the docs is really a good one at all -- I've written a lot of code with unsafe and I basically never do that except when I'm trying to shrink code artificically
<samth>
so I'm fine with just keeping it in the fixnum docs
<dzoe>
However I am not using those actively in any current project and therefore I am not inclined to suggest changes I didn't "test" (as in actual real project)
<dzoe>
I like the thing that you can simply revert back to fx... and other safe versions and immediately get reasonable error messages.
<eigenlicht>
Is there a way to set maximum recursion depth in racket?
<dzoe>
And the accidental require of unsafe-vector-ref taught me that there are places where ->i is REALLY a good idea.
<dzoe>
eigenlicht: You mean like setting a hard limit? I do not think so.
<eigenlicht>
dzoe, then how can I make unit tests that can handle infinte recursion?
<vraid>
eigenlicht: since recursion is a fundamental part of control flow, that seems like it could backfire
<dzoe>
I would try something like (define (fact n) (displayln (length (continuation-mark-set->context (current-continuation-marks)))) (if (> n 0) (* n (fact (sub1 n))) 1)) if you really need it.
<dzoe>
Try (fact 10) and see how the call stack grows.
<dzoe>
But - as vraid has pointed out - I would be careful or it will backfire.
<eigenlicht>
dzoe, is there a way to set at least a timeout?
<dzoe>
eigenlicht: You can always spawn a thread and kill it after given amount of time.
<eigenlicht>
dzoe, you mean I should use (require racket/engine)?
<vraid>
possibly also rewrite the recursive functions to take an optional countdown argument..
<dzoe>
eigenlicht: I would probably have to see the actual code to think about what may help here
Codaraxis has quit [Ping timeout: 260 seconds]
<eigenlicht>
dzone, I just need to test solution of students on my unit tests (RackUnit), but I need handle inf recursion too.
notzmv has joined #racket
<eigenlicht>
dzone, I thought there is an easy solution to this problem, but there isn't.
badkins has quit [Remote host closed the connection]
badkins has joined #racket
lockywolf_ has joined #racket
<dzoe>
But if the recursive call is at the tail position, it does not nest in the call stack anyway.
<dzoe>
So you definitely need to create some timeout constrain.