Skip to content

Commit

Permalink
[stdlib] retry() - sleep parameter can now be fractional (previously:…
Browse files Browse the repository at this point in the history
… integer)
ilyash-b committed Mar 3, 2024
1 parent 9d8e44e commit fd5b0b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/stdlib.ngs
Original file line number Diff line number Diff line change
@@ -8030,8 +8030,8 @@ section "retry() and friends" {
fail_cb={throw RetryFail()},
body:Fun={throw RetryBodyMissing("'body' argument missing in retry()")}
) {
guard sleep =~ AnyOf(Int, Iter)
sleep_iter = if sleep is Int then ConstIter(sleep) else sleep
guard sleep =~ AnyOf(Num, Iter) # Can't move to parameters as Iter is not defined at this point
sleep_iter = if sleep is Num then ConstIter(sleep) else sleep
result = null # otherwise it will be local to try { ... }
for(i;times) {
n = i + 1

0 comments on commit fd5b0b9

Please sign in to comment.