Skip to content

Commit

Permalink
Reusing time variable
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasWoeg authored Oct 17, 2022
1 parent c6da3d4 commit 27ef4a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions koans/std-method-comb.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@
(defmethod remaining-time :around ((object countdown))
(let ((time (call-next-method)))
(if (< 0 time)
;; PROG1 returns the value of the first expression in the sequence.
;; DECF is similar to INCF. It decreases the value stored in the place
;; and returns the decreased value.
;; PROG1 returns the value of the first expression in the sequence.
(prog1
(slot-value object 'remaining-time)
time
(decf (slot-value object 'remaining-time)))
:bang)))

Expand Down

0 comments on commit 27ef4a9

Please sign in to comment.