Skip to content

Commit

Permalink
Reusing value already bound to 'time'
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasWoeg authored Oct 17, 2022
1 parent a12c0a4 commit c6da3d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions koans-solved/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 c6da3d4

Please sign in to comment.