(define condition-type:invalid-floating-point-operation)
(define condition-type:macro-binding)
(define condition-type:no-such-restart)
-(define condition-type:not-8-bit-char)
(define condition-type:port-error)
(define condition-type:serious-condition)
(define condition-type:simple-condition)
(define error:derived-thread)
(define error:illegal-pathname-component)
(define error:macro-binding)
-(define error:not-8-bit-char)
(define error:unassigned-variable)
(define error:unbound-variable)
(define error:wrong-number-of-arguments)
'()
(arithmetic-error-report "Floating-point underflow"))))
\f
- (set! condition-type:not-8-bit-char
- (make-condition-type 'NOT-8-BIT-CHAR condition-type:error '(CHAR)
- (lambda (condition port)
- (write-string "Character too large for 8-bit string: " port)
- (write (access-condition condition 'CHAR) port)
- (newline port))))
-
(set! make-simple-error
(condition-constructor condition-type:simple-error
'(MESSAGE IRRITANTS)))
(condition-signaller condition-type:macro-binding
'(ENVIRONMENT LOCATION)
standard-error-handler))
- (set! error:not-8-bit-char
- (condition-signaller condition-type:not-8-bit-char
- '(CHAR)
- standard-error-handler))
unspecific)
\f
;;;; Utilities
condition-type:invalid-floating-point-operation
condition-type:macro-binding
condition-type:no-such-restart
- condition-type:not-8-bit-char
condition-type:port-error
condition-type:serious-condition
condition-type:simple-condition
error:file-operation
error:illegal-pathname-component
error:no-such-restart
- error:not-8-bit-char
error:wrong-number-of-arguments
error:wrong-type-argument
error:wrong-type-datum
((LOCAL) operations/bind)
((TOP-LEVEL) operations/bind-top-level)
((GLOBAL) operations/bind-global)
- (else (error "Unrecognized binding level" (declaration/binding-level declaration))))
+ (else
+ (error "Unrecognized binding level"
+ (declaration/binding-level declaration))))
operations
(declaration/operation declaration)
(declaration/variable declaration)
(define (known-declaration? operation)
(or (eq? operation 'EXPAND) ; this one is special
(assq operation known-declarations)))
-
-(define-guarantee known-declaration "known declaration")
\f
;;;; Integration Declarations
declarations/map
declarations/original
declarations/parse
- guarantee-known-declaration
+ known-declaration?
operations->external))
(define-package (scode-optimizer copy)
(vector-ref operations 2)))
(define (operations/bind operations operation variable value)
- (guarantee-known-declaration operation 'operations/bind)
+ (guarantee known-declaration? operation 'operations/bind)
(guarantee-variable variable 'operations/bind)
(vector (cons (cons* variable operation value)
(vector-ref operations 0))
(vector-ref operations 2)))
(define (operations/bind-top-level operations operation variable value)
- (guarantee-known-declaration operation 'operations/bind-top-level)
+ (guarantee known-declaration? operation 'operations/bind-top-level)
(guarantee-variable variable 'operations/bind-top-level)
(vector (vector-ref operations 0)
(cons (cons* variable operation value)
(vector-ref operations 2)))
(define (operations/bind-global operations operation variable value)
- (guarantee-known-declaration operation 'operations/bind-global)
+ (guarantee known-declaration? operation 'operations/bind-global)
(guarantee-variable variable 'operations/bind-global)
(vector (vector-ref operations 0)
(vector-ref operations 1)
define-*parser-expander
define-*parser-macro
global-parser-macros
- guarantee-parser-macros
make-parser-macros
parser-macros?
set-current-parser-macros!
(parser-table parser-macros-table))
(define (make-parser-macros parent)
- (if parent (guarantee-parser-macros parent 'MAKE-PARSER-MACROS))
+ (if parent (guarantee parser-macros? parent 'MAKE-PARSER-MACROS))
(%make-parser-macros (or parent *global-parser-macros*)
(make-strong-eq-hash-table)
(make-strong-eq-hash-table)))
(make-strong-eq-hash-table)
(make-strong-eq-hash-table)))
-(define (guarantee-parser-macros object procedure)
- (if (not (parser-macros? object))
- (error:wrong-type-argument object "parser macros" procedure)))
-
(define (define-matcher-macro name expander)
(hash-table/put! (matcher-macros-table *parser-macros*) name expander))
(loop (parent-macros environment))))))
(define (with-current-parser-macros macros thunk)
- (guarantee-parser-macros macros 'WITH-CURRENT-PARSER-MACROS)
+ (guarantee parser-macros? macros 'WITH-CURRENT-PARSER-MACROS)
(fluid-let ((*parser-macros* macros))
(thunk)))
*parser-macros*)
(define (set-current-parser-macros! macros)
- (guarantee-parser-macros macros 'SET-CURRENT-PARSER-MACROS!)
+ (guarantee parser-macros? macros 'SET-CURRENT-PARSER-MACROS!)
(set! *parser-macros* macros)
unspecific)
name-symbol)
(else
(let ((uri (->absolute-uri uri 'MAKE-XML-NAME)))
- (guarantee-xml-qname name-symbol 'MAKE-XML-NAME)
+ (guarantee xml-qname? name-symbol 'MAKE-XML-NAME)
(if (not (case (xml-qname-prefix name-symbol)
((xml) (uri=? uri xml-uri))
((xmlns) (uri=? uri xmlns-uri))
(or (xml-name-symbol? object)
(combo-name? object)))
-(define-guarantee xml-name "an XML Name")
-
(define (xml-name-string name)
(symbol->string (xml-name->symbol name)))
(define (xml-name->symbol name)
(cond ((xml-name-symbol? name) name)
((combo-name? name) (combo-name-qname name))
- (else (error:not-xml-name name 'XML-NAME->SYMBOL))))
+ (else (error:not-a xml-name? name 'XML-NAME->SYMBOL))))
(define (xml-name=? n1 n2)
(if (and (combo-name? n1) (combo-name? n2))
(define xml-name-symbol? (name-predicate string-is-xml-name?))
(define xml-nmtoken? (name-predicate string-is-xml-nmtoken?))
(define xml-qname? (name-predicate string-is-xml-qname?))
-
-(define-guarantee xml-name-symbol "an XML name symbol")
-(define-guarantee xml-nmtoken "an XML name token")
-(define-guarantee xml-qname "an XML QName")
\f
;;;; Namespace support
(or (xml-qname? object)
(combo-name? object)))
-(define-guarantee xml-namespace-conformant-name
- "XML Namespaces conformant name")
-
(define (xml-name-uri name)
(cond ((xml-qname? name) (null-xml-namespace-uri))
((combo-name? name) (expanded-name-uri (combo-name-expanded name)))
- (else (error:not-xml-namespace-conformant-name name 'XML-NAME-URI))))
+ (else (error:not-a xml-namespace-conformant-name? name 'XML-NAME-URI))))
(define (xml-name-uri=? name uri)
(uri=? (xml-name-uri name) uri))
(cond ((xml-qname? name) name)
((combo-name? name) (combo-name-qname name))
(else
- (error:not-xml-namespace-conformant-name name 'XML-NAME-PREFIX)))))
+ (error:not-a xml-namespace-conformant-name? name 'XML-NAME-PREFIX)))))
(define (null-xml-name-prefix? object)
(eq? object '||))
(define (xml-name-local name)
(cond ((xml-qname? name) (%xml-qname-local name))
((combo-name? name) (expanded-name-local (combo-name-expanded name)))
- (else (error:not-xml-namespace-conformant-name name 'XML-NAME-LOCAL))))
+ (else
+ (error:not-a xml-namespace-conformant-name? name 'XML-NAME-LOCAL))))
(define (xml-name-local=? name local)
(eq? (xml-name-local name) local))
(define xmlns-uri (->uri xmlns-uri-string))
(define (xml-qname-prefix qname)
- (guarantee-xml-qname qname 'XML-QNAME-PREFIX)
+ (guarantee xml-qname? qname 'XML-QNAME-PREFIX)
(%xml-qname-prefix qname))
(define (%xml-qname-prefix qname)
(null-xml-name-prefix)))))
(define (xml-qname-local qname)
- (guarantee-xml-qname qname 'XML-QNAME-LOCAL)
+ (guarantee xml-qname? qname 'XML-QNAME-LOCAL)
(%xml-qname-local qname))
(define (%xml-qname-local qname)
(MAKE-RECORD-TYPE ',root '(,@(map car slots))))
(DEFINE ,predicate
(RECORD-PREDICATE ,rtd))
- (DEFINE (,(symbol 'GUARANTEE- root) OBJECT CALLER)
- (IF (NOT ,predicate)
- (,error:not OBJECT CALLER)))
- (DEFINE (,error:not OBJECT CALLER)
- (ERROR:WRONG-TYPE-ARGUMENT
- OBJECT
- ,(string-append "an XML "
- (string-replace (symbol->string (cadr form))
- #\-
- #\space))
- CALLER))
(DEFINE ,%constructor
(RECORD-CONSTRUCTOR ,rtd '(,@(map car slots))))
(DEFINE (,constructor ,@slot-vars)
(loop (cdr attrs)))
#t))))
-(define-guarantee xml-attribute-list "XML attribute list")
-
(define (xml-content? object)
(list-of-type? object xml-content-item?))
(if (xml-element? elt)
(xml-element-attributes elt)
(begin
- (guarantee-xml-attribute-list elt 'FIND-XML-ATTR)
+ (guarantee xml-attribute-list? elt 'FIND-XML-ATTR)
elt)))))
(if (and (not attr) (if (default-object? error?) #f error?))
(error:bad-range-argument name 'FIND-XML-ATTR))
(if (string? arg)
(make-xml-name arg)
(begin
- (guarantee-xml-name arg caller)
+ (guarantee xml-name? arg caller)
arg)))
\f
(define-xml-type comment
(files "xml-names")
(parent (runtime xml))
(export ()
- error:not-xml-name
- error:not-xml-name-symbol
- error:not-xml-namespace-conformant-name
- error:not-xml-nmtoken
- error:not-xml-qname
- guarantee-xml-name
- guarantee-xml-name-symbol
- guarantee-xml-namespace-conformant-name
- guarantee-xml-nmtoken
- guarantee-xml-qname
make-xml-name
make-xml-name-symbol
make-xml-nmtoken
<xml-parameter-entity-ref>
<xml-processing-instructions>
<xml-unparsed-!entity>
- error:not-xml-!attlist
- error:not-xml-!element
- error:not-xml-!entity
- error:not-xml-!notation
- error:not-xml-attribute
- error:not-xml-attribute-list
- error:not-xml-comment
- error:not-xml-declaration
- error:not-xml-document
- error:not-xml-dtd
- error:not-xml-element
- error:not-xml-entity-ref
- error:not-xml-external-id
- error:not-xml-parameter-!entity
- error:not-xml-parameter-entity-ref
- error:not-xml-processing-instructions
- error:not-xml-unparsed-!entity
find-xml-attr
flatten-xml-element-content
- guarantee-xml-!attlist
- guarantee-xml-!element
- guarantee-xml-!entity
- guarantee-xml-!notation
- guarantee-xml-attribute
- guarantee-xml-attribute-list
- guarantee-xml-comment
- guarantee-xml-declaration
- guarantee-xml-document
- guarantee-xml-dtd
- guarantee-xml-element
- guarantee-xml-entity-ref
- guarantee-xml-external-id
- guarantee-xml-parameter-!entity
- guarantee-xml-parameter-entity-ref
- guarantee-xml-processing-instructions
- guarantee-xml-unparsed-!entity
make-xml-!attlist
make-xml-!element
make-xml-!entity
(html-document html-1.0-document)
(html-dtd html-1.0-dtd)
(html-external-id html-1.0-external-id)
- error:not-html-element
- error:not-html-element-name
- guarantee-html-element
- guarantee-html-element-name
html-1.0-document
html-1.0-dtd
html-1.0-external-id
canonicalize-rdf-subject
canonicalize-rdf-uri
copy-rdf-prefix-registry
- error:not-rdf-bnode
- error:not-rdf-graph
- error:not-rdf-literal
- error:not-rdf-object
- error:not-rdf-predicate
- error:not-rdf-prefix
- error:not-rdf-prefix-registry
- error:not-rdf-qname
- error:not-rdf-subject
- error:not-rdf-triple
event:new-rdf-graph
event:new-rdf-triple
for-each-rdf-triple
- guarantee-rdf-bnode
- guarantee-rdf-graph
- guarantee-rdf-literal
- guarantee-rdf-object
- guarantee-rdf-predicate
- guarantee-rdf-prefix
- guarantee-rdf-prefix-registry
- guarantee-rdf-qname
- guarantee-rdf-subject
- guarantee-rdf-triple
make-rdf-bnode
make-rdf-graph
make-rdf-literal