All pastes #214733 Raw Edit

Unnamed

public text v1 · immutable
#214733 ·published 2006-10-22 05:55 UTC
rendered paste body
(define (longest-word sym)
  (define convert 
    (lambda (l)
      (if(null? l)
         '()
         (append (convert (cdr l))(list(symbol->string (car l)))))))  
  (define (longest l str)
    (if(null? l)
       str
       (if(> (string-length (car l)) (string-length str))
          (longest (cdr l) (car l))
          (longest (cdr l) str))))
  (longest (convert sym) ""))
                
(longest-word '(the terms quote or quotation when used as a noun may have a meaning of a quotation mark which is a punctuation mark used to indicate that the enclosed words were spoken by someone))