Racket REPL doesn’t handle unicode well. If you try (regexp-match? #px"^[a-zA-Z]+$" "héllo") in DrRacket, or write it as a program in a file and run it, you will find that it does evaluate to #f.
--
You received this message because you are subscribed to the Google Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/2197C34F-165D-4D97-97AD-F158153316F5%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CADcuegsvf-hFwofptc2ieKQmqWFzxDnD1Cn8G7bFSzBZ%2BM3EDA%40mail.gmail.com.
Racket REPL doesn’t handle unicode well. If you try
(regexp-match? #px"^[a-zA-Z]+$" "héllo")in DrRacket, or write it as a program in a file and run it, you will find that it does evaluate to#f.
On Thu, Jul 9, 2020 at 7:19 AM Peter W A Wood <peter...@gmail.com> wrote:I was experimenting with regular expressions to try to emulate the Python isalpha() String method.
#lang racket
(module+ test
(require rackunit))
(define (char-letter? ch)
;; not the same as `char-alphabetic?`: see
;; https://docs.python.org/3/library/stdtypes.html#str.isalpha
(case (char-general-category ch)
[(lm lt lu ll lo) #t]
[else #f]))
(define (string-is-alpha? str)
(for/and ([ch (in-string str)])
(char-letter? ch)))
(module+ test
(check-true (string-is-alpha? "hello"))
(check-false (string-is-alpha? "h1llo"))
(check-true (string-is-alpha? "héllo")))
I did in fact try installing readline-gpl (raco pkg install readline-gpl), but it didn’t change anything. Interestingly, the bug in #3223 persists for me, too. This suggests that I didn’t install or invoke it correctly. Do you need to run racket with any flag to make readline-gpl take its effect?
But yes, the problem is definitely due to readline. Sam suggested me to try racket -q which suppresses readline, and the result is that there’s no issue.
--
You received this message because you are subscribed to the Google Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/09B244A4-89C5-4B5C-97E7-5487059125F6%40gmail.com.