Add view-doc generic

This function should return a string that explains what the view does.
This should remove the need to compile the undonerc in order to get
the explanation.
This commit is contained in:
Tom Willemsen 2012-10-04 11:05:30 +02:00
parent 35683db0e6
commit d6c24c4346
2 changed files with 6 additions and 2 deletions

View file

@ -219,5 +219,5 @@
(for-each (for-each
(lambda (view) (lambda (view)
(format #t "~a~20t~a~%" (format #t "~a~20t~a~%"
(car view) (procedure-documentation (cdr view)))) (car view) (view-doc (make (cdr view)))))
view-list))))) view-list)))))

View file

@ -1,13 +1,14 @@
(define-module (undone view) (define-module (undone view)
#:use-module (oop goops) #:use-module (oop goops)
#:export (<view> view-list sort-view filter-view print-item #:export (<view> view-list sort-view filter-view print-item
get-list-for print-view)) get-list-for print-view view-doc))
(define-generic sort-view) (define-generic sort-view)
(define-generic filter-view) (define-generic filter-view)
(define-generic print-item) (define-generic print-item)
(define-generic get-list-for) (define-generic get-list-for)
(define-generic print-view) (define-generic print-view)
(define-generic view-doc)
(define-class <view> () (define-class <view> ()
(todo-list #:init-value '() #:init-keyword #:todo-list)) (todo-list #:init-value '() #:init-keyword #:todo-list))
@ -33,3 +34,6 @@
(for-each (for-each
(lambda (item) (print-item v item)) (lambda (item) (print-item v item))
(get-list-for v))) (get-list-for v)))
(define-method (view-doc (v <view>))
"Default view, show only the basics.")