Skip to content

Instantly share code, notes, and snippets.

@akkartik
Created March 3, 2010 02:09
Show Gist options
  • Save akkartik/320227 to your computer and use it in GitHub Desktop.
Save akkartik/320227 to your computer and use it in GitHub Desktop.
(require (lib "mzlib/pregexp"))
; Repeatedly run regexp-replace over a list of words.
(let ((words (call-with-input-file "ztmp.words2"
(lambda(f) (read f)))))
(letrec ((fn (lambda()
(print "iter") (newline)
(map (lambda(x) (regexp-replace (pregexp "b.*") x ""))
; You can replace b with any letter. The input doesn't
; even have any b's.
words)
(fn))))
(fn)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment