schemedoc search functionality - 1

This commit is contained in:
erana 2012-01-17 23:58:09 +09:00
parent 831b1d9e94
commit 1e5b4fdd6d
3 changed files with 32 additions and 5 deletions

View File

@ -1,2 +1,2 @@
A pretty printing system A search utility which reads perl pod directories.
-- Johan Eventually scheme sod directories.

View File

@ -51,6 +51,25 @@
(set! SCHEMEDOCITEMS (append SCHEMEDOCITEMS (list (schemedoc-parser-grep (car l2))))) (set! SCHEMEDOCITEMS (append SCHEMEDOCITEMS (list (schemedoc-parser-grep (car l2)))))
))) )))
(display "Your search is in the variable SCHEMEDOCITEMS list.")(newline) (display "Your search is in the variable SCHEMEDOCITEMS list variable.")
(display "You can regexp it if you want.")(newline) (newline)
(display "You can regexp it if you want.")
(newline)
(define (schemedoc-search)
(display "Do you want to search for something ? (type y/n)")
(let ((s (read)))
(newline)
(cond ((and (symbol? s)(eq? s 'y))
(display "What do you want to search for ?")
(let ((s (read)))
(newline)
(let ((itemtexts (schemedoc-parser-get-items s SCHEMEDOCITEMS)))
(display "Do you want me to print the items of your search ?")
(let ((s (read)))
(newline)
(cond ((and (symbol? s)(eq? s 'y))
(display itemtexts))
(else (schemedoc-search)))))))
(else (schemedoc-search)))))
(schemedoc-search)

View File

@ -120,4 +120,12 @@
(set! directories (append directories (list directory))) (set! directories (append directories (list directory)))
(set! directory ""))) (set! directory "")))
(set! directory (string-append directory (string (string-ref SCHEMEDOCDIR i))))) (set! directory (string-append directory (string (string-ref SCHEMEDOCDIR i)))))
directories)) directories))
(define (schemedoc-parser-get-items keyword itemtexts)
(let ((returntext ""))
(do ((l itemtexts (cdr l)))
((null? l)0)
(cond ((string<=? keyword (car l))
(set! returntext (string-append returntext (car l))))))
returntext))