In my code below , I only want r.
(let* ((frac (multiple-value-bind (f r) (floor amt 100) r)))
..use frac..)
I get compilation warnings saying unused variable f.
Is there an idiomatic way of writing this?
In my code below , I only want r.
(let* ((frac (multiple-value-bind (f r) (floor amt 100) r)))
..use frac..)
I get compilation warnings saying unused variable f.
Is there an idiomatic way of writing this?
declare ignore
is generally useful in this context, here:
(multiple-value-bind (_ frac) (floor amt 100)
(declare (ignore _))
; use frac)
NTH-VALUE allows you to choose one of a form's return values. This will behave like your snippet:
(let* ((frac (nth-value 1 (floor amt 100))))
...)
© 2022 - 2024 — McMap. All rights reserved.
*
,**
,***
etc as names that indicate an unused variable. – Starknaked