[racket] I am trying to make little human like text searching program

From: John Clements (clements at brinckerhoff.org)
Date: Fri May 20 10:27:11 EDT 2011

On May 20, 2011, at 1:48 AM, 김태윤 wrote:

> hello
> I am trying to make little human like text searching program
> but there's bug that I can't catch for many hours
> the bug is
> when text.txt file contains
> explorer
> and when I am trying to find
> exp
> then error arise
> when the text.txt contains
> explorers
> and the time I trying to search
> expl
> the error
> list-ref: index 9 too large for list: (#\e #\x #\p #\l #\o #\r #\e #\r #\s)
> is arise on
> (equal? last-char (list-ref data (+ index len -1))))
> but the wierd thing is that
> when the text.txt file contains
> 2explorers
> and when I am trying to find
> 2explorer
> no error arise
> but
> finding 2explorers returns 0 Found

Test cases! Test cases!

If you're not familiar with How To Design Program's "design recipe", I *strongly* urge you to have a look. Its authors are also the authors of DrRacket.

http://www.htdp.org

John Clements

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4624 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20110520/f8ac5e87/attachment.p7s>

Posted on the users mailing list.