[racket-dev] current-*-port
I know I know. I can't script in anything but Racket.
And I have written such scripts and better still I teach such directory traversals to freshmen :-)
On May 4, 2012, at 11:11 AM, Laurent wrote:
>
>
> On Fri, May 4, 2012 at 5:04 PM, Neil Van Dyke <neil at neilvandyke.org> wrote:
> Matthias Felleisen wrote at 05/04/2012 10:41 AM:
> On May 4, 2012, at 10:34 AM, Laurent wrote
> An interesting idea would be to count the number of times each identifier is used in the sources, and see how many characters would be saved by using different conventions.
>
> That sounds like a fantastic exercise for someone who is truly skilled at scripting the shell with all kinds of find/wc/add knowledge.
>
> Heresy. Racket is actually well-suited for this task.
>
> (At the risk of stating the obvious... Well, you have to do some of the mechanics of directory tree traversal manually, unless someone's already written a "directory-fold" or similar.
>
> in-directory does what you want.
> http://docs.racket-lang.org/reference/sequences.html?q=in-directory#%28def._%28%28lib._racket/private/base..rkt%29._in-directory%29%29
>
> The main problem I recently had `read'ing scribble files was the #reader directives, which I had to remove by a regexp-replace before parsing the file (hoping that what follows the #reader is still in s-exp form). Not sure if there is a better solution(?).
>
> Laurent