Skip to content

Commit

Permalink
fix port-bol? return type
Browse files Browse the repository at this point in the history
  • Loading branch information
owaddell-beckman committed Nov 7, 2023
1 parent ccdd5ec commit 3743324
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions mats/6.ms
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,15 @@
(call-with-input-file "testfile.ss"
(lambda (p)
(string=? (get-string-all p) "a\n\nbc\n")))
(let ([op (open-output-string)])
;; disguise boolean? check just enough to prevent cp0 from folding
;; based on the declared return type; we need to actually check it
(define (check) (assert (memq (port-bol? op) '(#t #f))) #t)
(check)
(fprintf op "okay\n")
(check)
(write-char #\x op)
(check))
)

(mat char-ready?
Expand Down
2 changes: 1 addition & 1 deletion s/io.ss
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ implementation notes:

(define eol-char?
(lambda (c)
(memv c '(#\newline #\return #\nel #\ls))))
(and (memv c '(#\newline #\return #\nel #\ls)) #t)))

(define-syntax port-gz-mode
(syntax-rules ()
Expand Down

0 comments on commit 3743324

Please sign in to comment.