Skip to content

Instantly share code, notes, and snippets.

@podhmo
Created October 1, 2010 14:57
Show Gist options
  • Save podhmo/606315 to your computer and use it in GitHub Desktop.
Save podhmo/606315 to your computer and use it in GitHub Desktop.
(define (read-until p reader)
(let loop ((result '()))
(let1 e (reader)
(cond [(p e) (reverse result)]
[else (loop (cons e result))]))))
(define (read-sentence)
(display ":-) ")
(read-until (cut eq? <> '@) read)) ;;gaucheは'.を受け付けない
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment