Skip to content

WITH default binding for typed variables #14

@Bike

Description

@Bike

(loop with *package* = (find-package whatever)) expands into

(BLOCK NIL
  (LET ((*PACKAGE* NIL) (#:FORM542 (FIND-PACKAGE WHATEVER)))
    (DECLARE (IGNORABLE *PACKAGE*))
    (SETQ *PACKAGE* #:FORM542)
    (TAGBODY
     #:BODY543
      (GO #:BODY543)
     EPILOGUE
      (RETURN-FROM NIL NIL))))

i.e. it binds the variable to nil and then sets it. For a fresh lexical variable this is no problem, but *package* has to be a package, and binding it to a non-package has undefined consequences. On SBCL and Clasp it is an error. There would be a similar problem for any variable declared to have a type not including nil.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions