[plt-scheme] for-each being skipped

From: Andrey Skylar (skyarland at gmail.com)
Date: Wed Jul 13 09:48:20 EDT 2005

I'm writing some code that looks like this:

(define (func dir)
  (let ([list-of-dirs (filter directory-exists? (directory-list dir))]
    (for-each (lambda (val) (create-file-get-string val) list-of-dirs)
    (create-file-get-string dir)))

where create-file-get-string writes something to a file and then
returns a string (the file name).

The for-each statement doesn't seem to get executed when ever I call
func, but if I do everything out by hand it works.  Why is this
happening, and what can I do so that scheme doesn't skip the for-each
statment?

-Andrey



Posted on the users mailing list.