4 ms·
Makes sense. It's just to me, as someone who knows LOOP that (loop repeat n thereis (valid (read-password)) finally (lock-account)) seems si
by malisper 12y ago
Makes sense. It's just to me, as someone who knows LOOP that
(loop repeat n
thereis (valid (read-password))
finally (lock-account))
seems simpler than
(do ((i 0 (+ i 1)))
((>= i n) (lock-account))
(when (valid (read-password))
(return t)))
You are definitely right that loop is deceptively complex. In the code I gave, a reader would need to know that thereis skips the epilogue when terminating the loop (I would comment the code if it was going to be seen by others). I'm now finding it incredible how much lingo I used in the last sentence.