bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ice-9 lineio read-char versus unread-string


From: Kevin Ryde
Subject: ice-9 lineio read-char versus unread-string
Date: Mon, 24 Mar 2003 08:51:48 +1000
User-agent: Gnus/5.090017 (Oort Gnus v0.17) Emacs/21.2 (gnu/linux)

In guile 1.6.3 on a recent i386 debian I was nosing around ice-9
lineio and struck an apparent problem with read-char used after an
unread-string.  For instance a program foo.scm

        (use-modules (ice-9 lineio))
        (let ((port (make-line-buffering-input-port
                     (open-input-string "hello"))))
          (unread-string "world" port)
          (display (read-char port)) (newline))

run "guile -s foo.scm" produces

  ERROR: Wrong number of arguments to #<primitive-procedure string-ref>

whereas I hoped it would print a character.

I guess this is just a missing index for the string-ref call in the
getc handler of make-line-buffering-input-port.  Judging by the
substring taken I guess it should be 0.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]