Summary

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

Metadata

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.

Changes and comments

[2014-06-08 17:29:21 UTC] sjamaan set milestone to 4.10.0

[2014-06-08 17:29:21 UTC] sjamaan wrote:

This should be looked at and possibly fixed/documented

[2014-06-22 18:24:54 UTC] sjamaan wrote:

patch sent to chicken-hackers

[2014-07-02 08:30:50 UTC] sjamaan changed status from new to closed

[2014-07-02 08:30:50 UTC] sjamaan set resolution to fixed

[2014-07-02 08:30:50 UTC] sjamaan wrote:

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