From d6c24c4346692aefb310ee75ae60d29dec3d4e99 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 4 Oct 2012 11:05:30 +0200 Subject: [PATCH] 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. --- undone/main.scm | 2 +- undone/view.scm | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/undone/main.scm b/undone/main.scm index b175954..aae732b 100644 --- a/undone/main.scm +++ b/undone/main.scm @@ -219,5 +219,5 @@ (for-each (lambda (view) (format #t "~a~20t~a~%" - (car view) (procedure-documentation (cdr view)))) + (car view) (view-doc (make (cdr view))))) view-list))))) diff --git a/undone/view.scm b/undone/view.scm index ce1ef23..61ec5c7 100644 --- a/undone/view.scm +++ b/undone/view.scm @@ -1,13 +1,14 @@ (define-module (undone view) #:use-module (oop goops) #:export ( 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 filter-view) (define-generic print-item) (define-generic get-list-for) (define-generic print-view) +(define-generic view-doc) (define-class () (todo-list #:init-value '() #:init-keyword #:todo-list)) @@ -33,3 +34,6 @@ (for-each (lambda (item) (print-item v item)) (get-list-for v))) + +(define-method (view-doc (v )) + "Default view, show only the basics.")