Unexpected STRING-CI<=? behavior

54 views
Skip to first unread message

Nils M Holm

unread,
Sep 10, 2018, 2:11:21 PM9/10/18
to
Recently I ran a test suite and discovered the
following behavior in Chicken 4.13.0:

(string-ci<=? "test" "tes") ==> #t
(string-ci>=? "test" "tes") ==> #f

However, the strict predicates evaluate as expected:

(string-ci<? "test" "tes") ==> #f
(string-ci>? "test" "tes") ==> #t

Is this a bug or am I overlooking something?

--
Nils M Holm < n m h @ t 3 x . o r g > www.t3x.org

Takashi Kato

unread,
Sep 11, 2018, 4:31:55 AM9/11/18
to
I believe it's a bug.

string-ci<=? and string-ci>=? are defined like this:
(set! string-ci<=? (lambda (s1 s2)
(compare
s1 s2 'string-ci<=?
(lambda (len1 len2 cmp)
(if (eq? cmp 0)
(fx>= len1 len2) ;; ??
(fx< cmp 0) ) ) ) ) )
(set! string-ci>=? (lambda (s1 s2)
(compare
s1 s2 'string-ci>=?
(lambda (len1 len2 cmp)
(if (eq? cmp 0)
(fx<= len1 len2) ;; ??
(fx> cmp 0) ) ) ) ) )

And I think the position I marked with '??' should be fx<= and fx>=, respectively.

_/_/
Takashi

George Neuner

unread,
Sep 11, 2018, 12:19:16 PM9/11/18
to
On 10 Sep 2018 18:11:18 GMT, Nils M Holm <n...@ananda.local> wrote:

>Recently I ran a test suite and discovered the
>following behavior in Chicken 4.13.0:
>
>(string-ci<=? "test" "tes") ==> #t
>(string-ci>=? "test" "tes") ==> #f

That would seem to be backwards.

>Is this a bug or am I overlooking something?

Probably a bug.

Nils M Holm

unread,
Sep 11, 2018, 3:03:30 PM9/11/18
to
Takashi Kato <ktaka...@gmail.com> wrote:
> I believe it's a bug.

It is! I reported it and it was confirmed.
The maintainers are working on it.

Is this the Chicken code below? In this case
the fix should not take them too long!

Takashi Kato

unread,
Sep 12, 2018, 2:57:34 AM9/12/18
to
> Is this the Chicken code below? In this case
> the fix should not take them too long!
Yes, I saw this on library.scm of Chicken's source.
So, it should be a trivial change for them.

Cheers,
_/_/
Takashi
Reply all
Reply to author
Forward
0 new messages