Permalink
Browse files

Fixed accessor bug for intervals.

  • Loading branch information...
1 parent 59d5f64 commit 194a3fc422d44107341eaaf4475ad24d5c24f67d @tpapp committed Oct 3, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 src/bins.lisp
View
11 src/bins.lisp
@@ -114,11 +114,12 @@
(defun format-bin-location (location)
"Return location, formatted as a string."
- (etypecase location
- (interval (format nil "[~A,~A]"
- (format-number (interval-left location))
- (format-number (interval-right location))))
- (real (format-number location))))
+ (let+ (((&interval left right) location))
+ (etypecase location
+ (interval (format nil "[~A,~A]"
+ (format-number left)
+ (format-number right)))
+ (real (format-number location)))))
(defun binary-search (sorted i)
"Binary search for a number I on a sequence (vector preferred) sorted in

0 comments on commit 194a3fc

Please sign in to comment.