Opened 12 years ago

Closed 10 years ago

#878 closed defect (fixed)

expected results for SRFI-13's make-kmp-restart-vector

Reported by: Mario Domenech Goulart Owned by:
Priority: major Milestone: 4.10.0
Component: core libraries Version: 4.7.x
Keywords: srfi-13, make-kmp-restart-vector Cc:
Estimated difficulty:

Description

I'm using some SRFI-13 tests from Gauche that contain the following cases:

; This seems right to me, but is it?
(test '#(-1 0) (make-kmp-restart-vector "ab"))

; The following is from an example in the code, but I expect it is not right.
(test '#(-1 0 0 -1 1 2) (make-kmp-restart-vector "abdabx"))

The comments don't inspire much confidence.

Besides that, some implementations don't really agree on the results:

$ csi -n -R srfi-13
CHICKEN
(c)2008-2011 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.7.5 (rev 920581a)
linux-unix-gnu-x86 [ manyargs dload ptables ]
compiled 2012-06-29 on mario (Linux)

#;1> (use srfi-13)
#;2> (make-kmp-restart-vector "ab")
#(-1 -1)
#;3> (make-kmp-restart-vector "abdabx")
#(-1 -1 0 0 1 2)


$ gosh 
gosh> (use srfi-13)
#<undef>
gosh> (make-kmp-restart-vector "ab")
#(-1 0)
gosh> (make-kmp-restart-vector "abdabx")
#(-1 0 0 0 1 2)


$ scheme48
Welcome to Scheme 48 1.8 (made by mario on Qua Jun 27 17:24:32 BRT 2012)
Copyright (c) 1993-2008 by Richard Kelsey and Jonathan Rees.
Please report bugs to scheme-48-bugs@s48.org.
Get more information at http://www.s48.org/.
Type ,? (comma question-mark) for help.
> ,load-package srfi-13
> ,in srfi-13
srfi-13> (make-kmp-restart-vector "ab")
'#(-1 0)
srfi-13> (make-kmp-restart-vector "abdabx")
'#(-1 0 0 -1 1 2)

So:

For (make-kmp-restart-vector "ab")

CHICKEN:  #(-1 -1)
Gauche:   #(-1 0)
Scheme48: #(-1 0)

For (make-kmp-restart-vector "abdabx")

CHICKEN:  #(-1 -1 0 0 1 2)
Gauche:   #(-1 0 0 0 1 2)
Scheme48: #(-1 0 0 -1 1 2)

It seems that CHICKEN doesn't agree with Gauche and Scheme48 in those cases. I don't know what the correct values are.

Change History (3)

comment:1 Changed 10 years ago by sjamaan

Milestone: 4.10.0

This should be looked at and possibly fixed/documented

comment:2 Changed 10 years ago by sjamaan

patch sent to chicken-hackers

comment:3 Changed 10 years ago by sjamaan

Resolution: fixed
Status: newclosed

Fixed by 2ef671b6d4f3266815f7795b0d81d1d579f2056b and cherry-picked into stability as ff2dfea42dbd194ee77b257808a2838a12633429.

Note: See TracTickets for help on using tickets.