Hi,

I'm using the CHICKEN port [1] of Guile's gap-buffer implementation and
noticed a strange behavior in a simple test case.  I can reproduce that
behavior on Guile 2.0.5 and 2.0.9, but not on Guile 2.0.11.

[1] http://wiki.call-cc.org/eggref/4/gap-buffer

Here's the test case:

$ cat guile-gap-buffer.scm
(use-modules (ice-9 gap-buffer))

(define buffer (make-gap-buffer ""))

(define data
  
"aaaaa\nbbbbb\nccccc\nddddd\neeeee\nffff\nggggg\nhhhhh\niiiii\njjjjj\nkkkkk\nlllll\n")

(gb-insert-string! buffer data)

(display "Before goto-char: ")
(newline)
(display (gb->string buffer))
(newline)

(gb-goto-char buffer 1)

(display "After goto-char:")
(newline)
(display (gb->string buffer))
(newline)

$ guile -s guile-gap-buffer.scm
Before goto-char: 
aaaaa
bbbbb
ccccc
ddddd
eeeee
ffff
ggggg
hhhhh
iiiii
jjjjj
kkkkk
lllll

After goto-char:
aaaaa
bbbbb
ccccc
ddddd
eeeee
ffff
ggggg
hhhhh
iiiii
jjjjaaaaa
bbbbb
cc

$ guile --version
guile (GNU Guile) 2.0.5-deb+1-3
Copyright (C) 2011 Free Software Foundation, Inc.

License LGPLv3+: GNU LGPL 3 or later
<http://gnu.org/licenses/lgpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


With Guile 2.0.11 I get the expected behavior:

$ ~/local/guile-2.0.11/bin/guile -s guile-gap-buffer.scm
Before goto-char: 
aaaaa
bbbbb
ccccc
ddddd
eeeee
ffff
ggggg
hhhhh
iiiii
jjjjj
kkkkk
lllll

After goto-char:
aaaaa
bbbbb
ccccc
ddddd
eeeee
ffff
ggggg
hhhhh
iiiii
jjjjj
kkkkk
lllll


Do you know what may be causing the behavior observed with CHICKEN and
older Guile versions?

Best wishes.
Mario
-- 
http://parenteses.org/mario

Reply via email to