Very nice --- thanks!
At Tue, 25 May 2010 13:29:15 -0400, Danny Yoo wrote: > > We'd like to have more 7-line programs for the middle slideshow, so > > please contribute. > > Three programs: > > > > ;; gets the unique lines, although not guaranteeing order: > (let ([a-ht (for/fold ([a-ht #hash()]) > ([line (in-lines (current-input-port))]) > (hash-set a-ht line #t))]) > (for ([line (in-hash-keys a-ht)]) > (printf "~a~n" line))) > > > > ;; nl: show line numbers along the side > (for ([line (in-lines (current-input-port))] > [no (in-naturals 1)]) > (printf "~a: ~a~n" no line)) > > > > #lang racket > ;; Compute md5 checksum of the file given at the command line > (require scheme/cmdline > file/md5) > (printf "~a~n" (md5 (command-line #:args (filename) filename))) _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-dev