Permalink
Browse files

SELECT: Two changes

 - CL:RANDOM is only called once per SELECT expansion.

 - A pretty major thinkofix -- SELECT now actually loops when you
   pass no else clause.
  • Loading branch information...
1 parent d2cd0c4 commit 4a00517c926628d834742991b44ddbdedd5e374d @adlai adlai committed Oct 13, 2009
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/select.lisp
View
@@ -64,8 +64,9 @@ reserved for individual SELECT clauses."
,outer-next
,(if else-clause
(wrap-select-clause else-clause)
- `(setf ,repeat-counter ,num-clauses
- ,index (random ,num-clauses)))))))))))
+ `(progn
+ (setf ,repeat-counter ,num-clauses)
+ (go ,pick-clause)))))))))))
(defun clause-type (clause)
(cond ((when (symbolp (car clause))

0 comments on commit 4a00517

Please sign in to comment.