Skip to content

Instantly share code, notes, and snippets.

@bradclawsie
Created January 2, 2012 05:28
Show Gist options
  • Save bradclawsie/1549465 to your computer and use it in GitHub Desktop.
Save bradclawsie/1549465 to your computer and use it in GitHub Desktop.
loaddictionary3.rkt
#lang racket
(require racket/file)
(require (planet "memcached.rkt" ("jaymccarthy" "memcached.plt" 1 0)))
(define loaddict
(lambda (fn)
(let ([mc (memcached "localhost" 11212)])
(for-each (lambda (l)
(if (> (bytes-length l) 0)
(memcached-set! mc l #"1")
(printf "skip: ~a\n" l)))
(file->bytes-lines fn)))))
(loaddict "/usr/share/dict/words")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment