[Sbcl-help] weird error messagtes when ignoring variables in multiple-value-bind

0 views
Skip to first unread message

Jacek Podkanski via Sbcl-help

unread,
Sep 18, 2023, 7:40:48 PM9/18/23
to sbcl...@lists.sourceforge.net
    (multiple-value-bind  (xb yb width height)
        (cairo:text-extents *selection*)
      ;; (declare (ignore xb yb))
      (setf
       tw width
       th height))

I am trying to find the size of text drawn to cairo canvas.

I need help understanding the error messages when I try to ignore xb and by.

Trying the versions with declare form live and commented out does not give me any idea of how to ignore xb and yb and suppress the warning correctly.

Jacek Podkanski via Sbcl-help

unread,
Sep 18, 2023, 8:59:27 PM9/18/23
to sbcl...@lists.sourceforge.net
I found the correct way to ignore the variables. What tripped me was trying to ignore the same variables twice, in the multiple value bind and at the top of the function. Sorry for the confusion.

(defun draw-objects (w h)               ; view
  ;; trying to ignore xb and yb here as well was the source of confusion
  (format t ">>>>>>>> in draw-objects ~S " cairo:*context*)
  (let ((cnt (format nil "~S" *selection*))
        (tw 0)
        (th 0)
        (tpx 0)
        (tpy 0))
    (cairo:set-source-rgb 0 0 0)
    (cairo:select-font-face "Ubuntu Mono" :normal :bold)
    (cairo:set-font-size 20)


    (multiple-value-bind  (xb yb width height)
        (cairo:text-extents *selection*)
      (declare (ignore xb yb))

Stas Boukarev

unread,
Sep 18, 2023, 9:07:21 PM9/18/23
to Jacek Podkanski, sbcl...@lists.sourceforge.net
If you were using slime it would've highlighted the right form.

_______________________________________________
Sbcl-help mailing list
Sbcl...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help
Reply all
Reply to author
Forward
0 new messages