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:
parent
d35a116b8a
commit
1fe22a4dfd
2 changed files with 94 additions and 10 deletions
|
|
@ -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))))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue