Loops: :finish, :abandon, :while, :until and the :subloop form

The clause table, stopping early and nesting use the new names, and
count-lines uses :until instead of a counter that only drove the loop.

🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-opus-5-5)

Co-Authored-By: eca-agent <git@eca.dev>
This commit is contained in:
Linus Björnstam 2026-10-02 22:01:47 +02:00
parent d35a116b8a
commit 1fe22a4dfd
2 changed files with 94 additions and 10 deletions

View file

@ -500,8 +500,8 @@ To avoid leaking resources, you will usually want to use @code{call-with-input-f
(defun (count-lines path)
(call-with-input-file path
(fun (port)
(loop (:for i (up-from 0))
(:break-let (Some line) (read-line/opt port))
(loop (:until (port-eof? port))
(:let line (read-line port))
(:acc lines (counting line))
=> lines))))