page: Change sxml field to contents.

Naming the field 'sxml' is a poor choice because it may contain any type
of data that the writer procedure accepts.

* haunt/page.scm (<page>): Replace 'sxml' field with 'contents'.
  (page-sxml): Delete accessor.
  (page-contents): New accessor.
  (write-page): s/sxml/contents/
This commit is contained in:
David Thompson 2015-04-11 14:53:52 -04:00
parent 4d99832b6b
commit 7c7b161885
1 changed files with 4 additions and 4 deletions

View File

@ -35,15 +35,15 @@
write-page))
(define-record-type <page>
(make-page file-name sxml writer)
(make-page file-name contents writer)
page?
(file-name page-file-name)
(sxml page-sxml)
(contents page-contents)
(writer page-writer))
(define (write-page page output-directory)
"Write PAGE to OUTPUT-DIRECTORY."
(match page
(($ <page> file-name sxml writer)
(($ <page> file-name contents writer)
(let ((output (string-append output-directory "/" file-name)))
(call-with-output-file output (cut writer sxml <>))))))
(call-with-output-file output (cut writer contents <>))))))