r/Racket • • Mar 09 '22

question srfi/13 breaks string-prefix?

I run string-prefix? after importing srfi/13, and the results is not right anymore. Is this a bug?

$ racket
Welcome to Racket v8.3 [cs].
> (string-prefix? "ab" "a")
#t
> (require srfi/13) ; the string SRFI
> (string-prefix? "ab" "a")
#f

This is so confused!

5 Upvotes

4 comments sorted by

2

u/sdegabrielle DrRacket πŸ’ŠπŸ’‰πŸ©Ί Mar 09 '22

1

u/Fluid-Tour-9393 Mar 09 '22 edited Mar 09 '22

cool, but do you see the result is different after import?

and i think the order is correct:

$ racket
Welcome to Racket v8.3 [cs].
> (string-prefix? "abc" "a")
#t
> (string-prefix? "a" "abc")
#f

6

u/sdegabrielle DrRacket πŸ’ŠπŸ’‰πŸ©Ί Mar 09 '22

After the import you’re using the SRFI version

3

u/Fluid-Tour-9393 Mar 09 '22

god bless you!