Last active
August 29, 2015 14:13
-
-
Save mbertheau/e0160122da8787fbb28c to your computer and use it in GitHub Desktop.
Learning racket
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 | |
(define hangul-data-file "src/racket-unihan/Unihan_Readings.txt") | |
(define (port-filter predicate) | |
(define next-line | |
(lambda (in) | |
(define l (read-line in)) | |
(if (or (eof-object? l) | |
(predicate l)) | |
l | |
(next-line in)))) | |
next-line) | |
(define (hangul-filter l) | |
(or (eq? (string-length l) 0) | |
(not (eq? (string-ref l 0) #\#)))) | |
(define r1 (call-with-input-file hangul-data-file | |
(lambda (in) | |
(for/list ([l (in-port (port-filter hangul-filter) in)] | |
[n 30]) | |
l)))) |
soegaard
commented
Jan 12, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment