Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • I iterate
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 18
    • Issues 18
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • iterate
  • iterate
  • Issues
  • #4
Closed
Open
Issue created Nov 05, 2020 by Michał Herda@mherda🤔

New SBCL warnings about set-but-not-read variables

Thanks to @pmarek for the heads-up.

SBCL 2.0.9 introduced warnings about variables which are assigned but never read and about variables which are assigned but ignored. This currently means that e.g.

(iterate (for a in '(1 2 3)))

produces a A is assigned but never read style warning, whereas

(iterate (for a in '(1 2 3)) (declare (ignore a)))

produces a A is being set even though it was declared to be ignored style warning.


A possible solution would be to declare all variables bound by Iterate as ignorable, which is what SBCL's LOOP internally does:

CL-USER> (macroexpand-1 '(loop for (a b c) in '()))
(BLOCK NIL
  (LET ((A NIL) (B NIL) (C NIL) (#:LOOP-LIST-519 'NIL))
    (DECLARE (IGNORABLE #:LOOP-LIST-519)
             (IGNORABLE C)
             (IGNORABLE B)
             (IGNORABLE A))
    (TAGBODY
      (GO SB-LOOP::END-LOOP)
     SB-LOOP::NEXT-LOOP
      (SB-LOOP::LOOP-DESETQ (A B C) (CAR #:LOOP-LIST-519))
      (SB-LOOP::LOOP-DESETQ #:LOOP-LIST-519 (CDR #:LOOP-LIST-519))
      (WHEN (ENDP #:LOOP-LIST-519) (GO SB-LOOP::END-LOOP))
      (GO SB-LOOP::NEXT-LOOP)
     SB-LOOP::END-LOOP)))
T
Edited Nov 05, 2020 by Michał Herda
Assignee
Assign to
Time tracking