From: Sam Tobin-Hochstadt (samth at ccs.neu.edu) Date: Wed May 26 12:42:04 EDT 2010 |
|
On Wed, May 26, 2010 at 12:34 PM, Jay McCarthy <jay.mccarthy at gmail.com> wrote: > And I would recommend using hash-ref! to save a line. #lang racket ;; Report each unique line from stdin: (let ([saw (make-hash)]) (for ([line (in-lines)]) (hash-ref! saw line (λ () (displayln line))))) Slick. -- sam th samth at ccs.neu.edu
Posted on the dev mailing list. |
|