From df71dd6798e7a061b59c351a6aabdb45032f2df3 Mon Sep 17 00:00:00 2001 From: erana Date: Tue, 17 Jan 2012 21:02:38 +0900 Subject: [PATCH] schemedoc ow parser --- scsh/schemedoc/schemedoc.scm | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/scsh/schemedoc/schemedoc.scm b/scsh/schemedoc/schemedoc.scm index 315998c..c21a6bd 100644 --- a/scsh/schemedoc/schemedoc.scm +++ b/scsh/schemedoc/schemedoc.scm @@ -55,4 +55,27 @@ (do ((e ll (cdr e))) ((null? e)0) (display (car e) out))) - (display-rec l)))) \ No newline at end of file + (display-rec l)))) + +;; +;; make a list of chars from filename contents +;; +(define (schemedoc-explode-doc filename) + (define (explode in) + (let ((c (read-char in))) + (if (eof-object? c) + c + (append (list c) (explode in))))) + + (define (read-rec in) + (call-with-values + (lambda () + (explode in) + ) + (lambda (l) + (display l) + l))) + + (let ((in (open-input-file filename))) + (read-rec in) + ))