[racket] This is too clumsy. Is there a better way?

From: Ian Tegebo (ian.tegebo at gmail.com)
Date: Fri Jul 13 11:43:03 EDT 2012

On Fri, Jul 13, 2012 at 6:02 AM, Rouben Rostamian <rostamian at umbc.edu> wrote:
> (define (all-lower-case? str)
>   (not (memq #t
>              (map (lambda (i)
>                     (if (and (char-alphabetic? i) (char-upper-case? i))
>                       #t #f))
>                   (string->list str)))))
>
> This looks rather clumsy to me. [...]  Any suggestions?
So far, no one has suggested a regexp.  Why not,

(define (all-lower-case? s) (not (regexp-match? #rx"[A-Z]" s)))

-- 
Ian Tegebo

Posted on the users mailing list.