make-binary-input-port calling convention

Peter McGoron via Chicken-users <[email protected]> Mon, 18 May 2026 20:04:32 -0400
Newsgroups gmane.lisp.scheme.chicken
Message-ID <[email protected]>
The manual page[1] for make-binary-input-port says that 
`read-bytevector` will be called with 4 arguments, but it gets called 
with 3.

[1]: 
https://wiki.call-cc.org/man/6/Module%20(chicken%20port)#make-binary-input-port

(import (scheme base) (chicken port))

(let ((custom (make-binary-input-port
                (lambda () 0)
                (lambda () #t)
                (lambda () #t)
                #:read-bytevector
                (lambda (port num bv offset)
                  (display "foobar\n")
                  (do ((i 0 (+ i 1)))
                      ((= i num) num)
                    (bytevector-u8-set! bv (+ offset i) 0))))))
   (read-bytevector 10 custom))

Raises an argument mismatch error.

-- Peter McGoron