seanjensengrey / mosh-scheme

Automatically exported from code.google.com/p/mosh-scheme
Other
0 stars 0 forks source link

Custom binary port doesn't respect returned count #244

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run the following

(import (rnrs))

(define (make-custom)
  (define (close) #t)
  (define (write! bv start count)
    (display (bytevector-u8-ref bv start)) (newline)
    1)
  (make-custom-binary-output-port "test" write! #f #f close))

(let ((o (make-custom)))
  (put-bytevector o #vu8(1 2 3 4 5))
  (display 'ok)(newline))

What is the expected output? What do you see instead?
1
2
3
4
5
ok

1
ok

What version of the product are you using? On what operating system?
% mosh -V
Mosh R6RS scheme interpreter, version 0.2.7 (mosh-0.2.7 Tue, 14 Jun 2011 
07:00:31 +0900)

On Cygwin

Please provide any additional information below.
I'm not sure if this is specified on R6RS however textual port works as 
expected.

Original issue reported on code.google.com by ktakash...@gmail.com on 23 Oct 2014 at 7:37