Skip to content

Style: Specialize generic function methods more precisely #238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions quicklisp/progress.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@
(defgeneric elapsed-time (progress-bar))
(defgeneric units-per-second (progress-bar))

(defmethod start-display (progress-bar)
(defmethod start-display ((progress-bar progress-bar))
(setf (last-update-time progress-bar) (get-internal-real-time))
(setf (start-time progress-bar) (get-internal-real-time))
(fresh-line)
(finish-output))

(defmethod update-display (progress-bar)
(defmethod update-display ((progress-bar progress-bar))
(incf (progress progress-bar) (pending progress-bar))
(setf (pending progress-bar) 0)
(setf (last-update-time progress-bar) (get-internal-real-time))
Expand All @@ -78,14 +78,14 @@
(write-char (progress-character progress-bar)))
(finish-output)))

(defmethod update-progress (progress-bar unit-count)
(defmethod update-progress ((progress-bar progress-bar) unit-count)
(incf (pending progress-bar) unit-count)
(let ((now (get-internal-real-time)))
(when (< (update-interval progress-bar)
(- now (last-update-time progress-bar)))
(update-display progress-bar))))

(defmethod finish-display (progress-bar)
(defmethod finish-display ((progress-bar progress-bar))
(update-display progress-bar)
(setf (end-time progress-bar) (get-internal-real-time))
(terpri)
Expand All @@ -95,11 +95,11 @@
(/ (units-per-second progress-bar) 1024))
(finish-output))

(defmethod elapsed-time (progress-bar)
(defmethod elapsed-time ((progress-bar progress-bar))
(/ (- (end-time progress-bar) (start-time progress-bar))
internal-time-units-per-second))

(defmethod units-per-second (progress-bar)
(defmethod units-per-second ((progress-bar progress-bar))
(if (plusp (elapsed-time progress-bar))
(/ (total progress-bar) (elapsed-time progress-bar))
0))
Expand Down
2 changes: 1 addition & 1 deletion quicklisp/setup.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
(length (quicklisp-systems strategy)))))

(defgeneric quicklisp-releases (strategy)
(:method (strategy)
(:method ((strategy load-strategy))
(remove-duplicates (mapcar 'release (quicklisp-systems strategy)))))

(defgeneric quicklisp-release-table (strategy)
Expand Down