[plt-scheme] my solution to printing out module provides

From: Corey Sweeney (corey.sweeney at gmail.com)
Date: Mon Jul 2 17:37:31 EDT 2007

Here's my solution to displaying the index of module "provides" in a
printable format, if anyone wants to use it for themselfs:

;list your files here
(define files
  (list "file1.ss"
        "file2.ss"))

(display "NOTE: IF THERES A MULTIMEDIA FILE IN YOUR FILE LIST, YOUR
SCREWED!  don't attempt multimedia files :)")

 (map (lambda (x)
        (let ([file-contents (read (open-input-file x))])
          (append (list (second file-contents))
                  (filter (lambda (a) (and (list? a)
                                           (< 1 (length a))
                                           (equal? 'provide (first a))))
                          file-contents))))
      files)


Corey

-- 
((lambda (y) (y y)) (lambda (y) (y y)))


Posted on the users mailing list.