Created
December 27, 2011 07:04
-
-
Save bradclawsie/1522937 to your computer and use it in GitHub Desktop.
loaddictionary2.rkt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require racket/file) | |
(require (planet "memcached.rkt" ("jaymccarthy" "memcached.plt" 1 0))) | |
(define loaddict | |
(lambda (fn) | |
(let ([mc (memcached "localhost" 11212)] | |
[lines (file->bytes-lines fn)]) | |
(for-each (lambda (l) | |
(if (> (bytes-length l) 0) | |
(memcached-set! mc l #"1") | |
(printf "skip: ~a\n" l))) | |
lines)))) | |
(loaddict "/usr/share/dict/words") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment