Hey Sven, > > (string-ci<=? "test" "tes") > #t > > (string-ci>=? "test" "tes") > #f
This is odd. Here's some source code: (set! scheme#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! scheme#string-ci>=? (lambda (s1 s2) (compare s1 s2 'string-ci>=? (lambda (len1 len2 cmp) (if (eq? cmp 0) (fx<= len1 len2) (fx> cmp 0) ) ) ) ) ) >From what I can tell, `cmp` ends up being zero if the `memcmp` called by `compare` returns zero for both strings, with the smaller length as last argument. This happens when they share the same prefix, so in this case you'd run into that branch, then compare `len1` against `len2`. As `len1` is larger, `string-ci<=?` returns #t. The question is, what should the correct comparator be here? Vasilij _______________________________________________ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users