From a132df19eabf5d77b0eac7e870178803f1b0dd07 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Sat, 9 Jul 2022 11:03:02 +0530 Subject: document: Generalize document-type method of parent class. * tissue/document.scm (document-type): Generalize generic method of to apply to most child classes. Pass on generic method of to that of . * tissue/issue.scm (document-type): Remove generic method for class. --- tissue/document.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tissue/document.scm') diff --git a/tissue/document.scm b/tissue/document.scm index e46e055..b12ccbb 100644 --- a/tissue/document.scm +++ b/tissue/document.scm @@ -137,7 +137,8 @@ that operates on a copy of OBJECT. It does not mutate OBJECT." (web-uri #:accessor document-web-uri #:init-keyword #:web-uri)) (define-method (document-type (document )) - "document") + (string-trim-both (symbol->string (class-name (class-of document))) + (char-set #\< #\>))) (define-method (document-term-generator (document )) "Return a term generator for DOCUMENT. The returned term generator has @@ -158,6 +159,9 @@ and further text, increase-termpos! must be called before indexing." (define-class () (path #:accessor file-document-path #:init-keyword #:path)) +(define-method (document-type (document )) + (next-method)) + (define-method (document-id-term (document )) "Return the ID term for DOCUMENT." (string-append "Q" (file-document-path document))) -- cgit v1.2.3