katsu #556(2007/07/11 08:47 GMT) [ Scheme ] Rating0/0=0.00
正規表現使ったら、負けかなと思ったりします。 愚直に、一文字ずつ
1 2 3 4 5 6 7 8 9 10
(define (comment a) (with-output-to-string (lambda () (with-input-from-string a (lambda () (let loop ((sw #t) (c (read-char))) (let ((loopx (cut loop <> (read-char))) (test-char-peek (lambda (x y) (and (char=? c x) (char=? (peek-char) y))))) (cond ((eof-object? c) #t) ((and sw (test-char-peek #\/ #\*)) (loopx #f)) ((and (not sw) (test-char-peek #\* #\/)) (read-char) (loopx #t)) (else (when sw (write-char c)) (loopx sw))))))))))
Rating0/0=0.00-0+
[ reply ]
katsu
#556()
[
Scheme
]
Rating0/0=0.00
Rating0/0=0.00-0+
[ reply ]