Skip to content
  1. Dec 29, 2023
  2. Dec 17, 2022
  3. Dec 08, 2021
  4. Dec 03, 2021
  5. Aug 20, 2021
  6. Aug 19, 2021
  7. May 23, 2021
  8. May 19, 2021
  9. May 18, 2021
    • Steve Losh's avatar
      Fix control flow when the loop contains NIL blocks · e0cc021a
      Steve Losh authored and Robert Goldman's avatar Robert Goldman committed
      Control flow clauses that return from an iterate form without executing
      the epilogue code (e.g. `never` and `leave`) currently do so by
      expanding into `(return-from ,*block-name*)`.  For iterate forms without
      a user-provided name, the block will be named `nil`.  This causes
      problems when used with other Common Lisp looping constructs such as
      `dolist`:
      
          (iterate
            (for i :from 0 :below 10)
            (dolist (x '(5 10 15))
              (never (= i x))))
          ; => T, but should be NIL
      
      This patch adds a separate `*loop-name*` variable that will be bound to
      a gensym for `NIL`-named blocks and makes the various epilogue-skipping
      code refer to that instead of `*block-name*`.  Iterate forms *without*
      an explicit user-provided name will still have a separate `(block nil
      ...)` wrapping so users can still `(return ...)` as before.
      
      Before (simplified):
      
          (iterate (leave))
          ; ==> (block nil (return-from nil))
      
          (iterate foo (leave))
          ; ==> (block foo (return-from nil))
      
      After:
      
          (iterate (leave))
          ; ==> (block nil (block #:ITERATE123 (return-from #:ITERATE123)))
      
          (iterate foo (leave))
          ; ==> (block foo (return-from foo))
      e0cc021a
  10. May 17, 2021
  11. Feb 03, 2021
  12. May 11, 2020
  13. Jan 25, 2020
  14. Feb 07, 2018
  15. Jan 23, 2018
  16. Jan 16, 2018