Skip to content

Instantly share code, notes, and snippets.

@bradclawsie
Created December 27, 2011 07:04
Show Gist options
  • Save bradclawsie/1522937 to your computer and use it in GitHub Desktop.
Save bradclawsie/1522937 to your computer and use it in GitHub Desktop.
loaddictionary2.rkt
#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