unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* ice-9 lineio read-char versus unread-string
@ 2003-03-23 22:51 Kevin Ryde
  2003-05-03 20:26 ` Marius Vollmer
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Ryde @ 2003-03-23 22:51 UTC (permalink / raw)


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.


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ice-9 lineio read-char versus unread-string
  2003-03-23 22:51 ice-9 lineio read-char versus unread-string Kevin Ryde
@ 2003-05-03 20:26 ` Marius Vollmer
  2003-05-05 17:47   ` Neil Jerram
  0 siblings, 1 reply; 5+ messages in thread
From: Marius Vollmer @ 2003-05-03 20:26 UTC (permalink / raw)
  Cc: bug-guile

Kevin Ryde <user42@zip.com.au> writes:

> 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.

Right.  Fixed in both branches, although I think the code hasn't
been used for three years or so...

The (ice-9 lineio) module was there to fix a deficiency in the core
ports and the original author expected it to be removed somewhen.
Maybe we should just do that.  Anybody?

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ice-9 lineio read-char versus unread-string
  2003-05-03 20:26 ` Marius Vollmer
@ 2003-05-05 17:47   ` Neil Jerram
  2003-05-13 17:33     ` Marius Vollmer
  2003-05-13 17:46     ` Paul Jarc
  0 siblings, 2 replies; 5+ messages in thread
From: Neil Jerram @ 2003-05-05 17:47 UTC (permalink / raw)
  Cc: bug-guile

>>>>> "Marius" == Marius Vollmer <mvo@zagadka.de> writes:

    Marius> Kevin Ryde <user42@zip.com.au> writes:
    >> 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.

    Marius> Right.  Fixed in both branches, although I think the code hasn't
    Marius> been used for three years or so...

    Marius> The (ice-9 lineio) module was there to fix a deficiency in the core
    Marius> ports and the original author expected it to be removed somewhen.
    Marius> Maybe we should just do that.  Anybody?

The (poor) comment doesn't say what that deficiency was.  Does anyone
know?  And if so, has it been fixed?

If no one knows, I support removing this from Guile core.

        Neil



_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ice-9 lineio read-char versus unread-string
  2003-05-05 17:47   ` Neil Jerram
@ 2003-05-13 17:33     ` Marius Vollmer
  2003-05-13 17:46     ` Paul Jarc
  1 sibling, 0 replies; 5+ messages in thread
From: Marius Vollmer @ 2003-05-13 17:33 UTC (permalink / raw)
  Cc: bug-guile

Neil Jerram <neil@ossau.uklinux.net> writes:

> The (poor) comment doesn't say what that deficiency was.  Does anyone
> know?  And if so, has it been fixed?

I have to say I don't understand what the purpose of lineio is and in
what way the core ports should be fixed.

I think we should deprecate the whole (ice-9 lineio) module.


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ice-9 lineio read-char versus unread-string
  2003-05-05 17:47   ` Neil Jerram
  2003-05-13 17:33     ` Marius Vollmer
@ 2003-05-13 17:46     ` Paul Jarc
  1 sibling, 0 replies; 5+ messages in thread
From: Paul Jarc @ 2003-05-13 17:46 UTC (permalink / raw)
  Cc: Marius Vollmer

Neil Jerram <neil@ossau.uklinux.net> wrote:
>>>>>> "Marius" == Marius Vollmer <mvo@zagadka.de> writes:
>     Marius> The (ice-9 lineio) module was there to fix a deficiency in the core
>     Marius> ports and the original author expected it to be removed somewhen.
>     Marius> Maybe we should just do that.  Anybody?
>
> The (poor) comment doesn't say what that deficiency was.  Does anyone
> know?  And if so, has it been fixed?

The functionality of (ice-9 lineio) is duplicated in the built-in
unread-string and the (ice-9 rdelim) module.  So, not knowing the
actual history, I would guess that (ice-9 lineio) predates them.  In
that case, now that we have those two, it would seem that lineio is no
longer needed.


paul


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-05-13 17:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-23 22:51 ice-9 lineio read-char versus unread-string Kevin Ryde
2003-05-03 20:26 ` Marius Vollmer
2003-05-05 17:47   ` Neil Jerram
2003-05-13 17:33     ` Marius Vollmer
2003-05-13 17:46     ` Paul Jarc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).