OUTDATER added; URL tag accepts more text fields now

This commit is contained in:
interp 2002-10-01 12:10:15 +00:00
parent 1ac0705aae
commit 4fdd1cdbbb
1 changed files with 28 additions and 1 deletions

View File

@ -144,7 +144,10 @@
(define URL-rule
(cons 'URL
(lambda (tag URI text) (list "<a href=\"" URI "\">" text "</a>"))))
(lambda (tag URI . maybe-text) (list "<a href=\"" URI "\">"
(if (pair? maybe-text)
maybe-text
URI)"</a>"))))
(define default-rules
`(,attribute-rule
@ -163,10 +166,34 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; outdater
(define-record-type outdater :outdater
(real-make-outdater outdated?)
outdater?
(outdated? outdater-outdated? set-outdater-outdated?!))
(define (make-outdater)
(real-make-outdater #f))
(define-syntax if-outdated
(syntax-rules ()
((if-outdated outdater consequence alternative)
(if (outdater-outdated? outdater)
consequence
(begin
(set-outdater-outdated?! outdater #t)
alternative)))))
(define (show-outdated url)
(send-html
`(html (title "Outdated Data")
(body (h1 "Outdated Data")
(p "The page or action you requested relies on outdated data")
(p "Try to "
(URL ,url "reload")
" the page to get current data.")))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; input-fields