[plt-scheme] simple scheme idiom for generalized maximum?

From: John Clements (clements at brinckerhoff.org)
Date: Wed Sep 23 14:15:39 EDT 2009

On Sep 23, 2009, at 11:12 AM, Matthias Felleisen wrote:

>
> (define (longest-string los)
>  (first (sort los > #:key string-length)))
>

I thought of that, but it seems like the wrong program: I don't want  
the list sorted, I just want the maximum.

I suppose that from a purely declarative standpoint, you could argue  
that this doesn't necessarily imply extra computation, but that seems  
like a stretch.

John

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2484 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20090923/73919388/attachment.p7s>

Posted on the users mailing list.