(define (button-name button)
(symbol->string (button-symbol button)))
-(set-record-type-unparser-method! <button>
+(define-unparser-method button?
(simple-unparser-method (record-type-name <button>)
(lambda (button)
(list (button-symbol button)))))
'<= binary-input-port?
'<= binary-output-port?)))
-(set-record-type-unparser-method! <binary-port>
+(define-unparser-method binary-port?
(standard-unparser-method
(lambda (port)
- (cond ((binary-i/o-port? port) 'BINARY-I/O-PORT)
- ((binary-input-port? port) 'BINARY-INPUT-PORT)
- ((binary-output-port? port) 'BINARY-OUTPUT-PORT)
- (else 'BINARY-PORT)))
+ (cond ((binary-i/o-port? port) 'binary-i/o-port)
+ ((binary-input-port? port) 'binary-input-port)
+ ((binary-output-port? port) 'binary-output-port)
+ (else 'binary-port)))
#f))
\f
;;;; Bytevector input ports
(define (define-bundle-printer interface printer)
(hash-table-set! bundle-printers interface printer))
-(set-record-type-entity-unparser-method! <bundle-metadata>
+(define-unparser-method bundle?
(standard-unparser-method
(lambda (bundle)
(bundle-interface-name (bundle-interface bundle)))
(if printer
(printer bundle port))))))
-(set-record-type-entity-describer! <bundle-metadata>
+(define-pp-describer bundle?
(lambda (bundle)
(map (lambda (name)
(list name (bundle-ref bundle name)))
;; two digits representing a larger number, then RADIX is their base.
(define %radix)
-(set-record-type-unparser-method! rtd:alien
+(define-unparser-method alien?
(standard-unparser-method
'alien
(lambda (alien port)
(define-guarantee http-header "HTTP header field")
-(set-record-type-unparser-method! <http-header>
+(define-unparser-method http-header?
(simple-unparser-method 'HTTP-HEADER
(lambda (header)
(list (http-header-name header)))))
(guarantee-headers&body headers body 'MAKE-HTTP-REQUEST)
(%make-http-request method uri version headers body)))
-(set-record-type-unparser-method! <http-request>
+(define-unparser-method http-request?
(simple-unparser-method 'HTTP-REQUEST
(lambda (request)
(list (http-request-method request)
(guarantee-headers&body headers body 'MAKE-HTTP-RESPONSE)
(%make-http-response version status reason headers body)))
-(set-record-type-unparser-method! <http-response>
+(define-unparser-method http-response?
(simple-unparser-method 'HTTP-RESPONSE
(lambda (response)
(list (http-response-status response)))))
(let ((tag (record-type-dispatch-tag rtd)))
(set! package-tag tag)
(for-each (lambda (p) (%record-set! p 0 tag)) *packages*))
- (set-record-type-unparser-method! rtd
- (simple-unparser-method 'PACKAGE
+ (define-unparser-method (record-predicate rtd)
+ (simple-unparser-method 'package
(lambda (package)
(list (package/name package)))))))
\f
(flush-output port-type-operation:flush-output)
(discretionary-flush-output port-type-operation:discretionary-flush-output))
-(set-record-type-unparser-method! <textual-port-type>
+(define-unparser-method textual-port-type?
(standard-unparser-method
(lambda (type)
(if (port-type-supports-input? type)
(register-predicate! textual-i/o-port? 'textual-i/o-port
'<= textual-port?)))
-(set-record-type-unparser-method! <textual-port>
+(define-unparser-method textual-port?
(standard-unparser-method
(lambda (port)
(cond ((textual-i/o-port? port) 'TEXTUAL-I/O-PORT)
,((record-accessor type field-name) record)))
(record-type-field-names type)))))
-;;; These are for backwards compatibility:
-
+;;; For backwards compatibility:
(define (set-record-type-unparser-method! record-type method)
(define-unparser-method (record-predicate record-type)
method))
-
-(define (set-record-type-describer! record-type describer)
- (define-pp-describer (record-predicate record-type)
- describer))
-
-(define (set-record-type-entity-unparser-method! record-type method)
- (define-unparser-method (record-entity-predicate record-type)
- method))
-
-(define (set-record-type-entity-describer! record-type describer)
- (define-pp-describer (record-entity-predicate record-type)
- describer))
\f
;;;; Runtime support for DEFINE-STRUCTURE
(define-guarantee rfc2822-header "RFC 2822 header field")
-(set-record-type-unparser-method! <rfc2822-header>
+(define-unparser-method rfc2822-header?
(simple-unparser-method 'rfc2822-header
(lambda (header)
(list (rfc2822-header-name header)))))
(define-package (runtime record)
(files "record")
(parent (runtime))
+ (export () deprecated:record
+ set-record-type-unparser-method!)
(export ()
%copy-record
%make-record
record-type-name
record-type?
record-updater
- record?
- set-record-type-describer!
- set-record-type-entity-describer!
- set-record-type-entity-unparser-method!
- set-record-type-unparser-method!)
+ record?)
(export (runtime)
error:no-such-slot
error:uninitialized-slot
(define top-level-mime-types
'#(TEXT IMAGE AUDIO VIDEO APPLICATION MULTIPART MESSAGE))
-(set-record-type-unparser-method! <mime-type>
+(define-unparser-method mime-type?
(standard-unparser-method 'MIME-TYPE
(lambda (mime-type port)
(write-char #\space port)
(host uri-authority-host)
(port uri-authority-port))
-(set-record-type-unparser-method! <uri-authority>
- (simple-unparser-method 'URI-AUTHORITY
+(define-unparser-method uri-authority?
+ (simple-unparser-method 'uri-authority
(lambda (authority)
(list (call-with-output-string
(lambda (port)
(fragment partial-uri-fragment set-partial-uri-fragment!)
(extra partial-uri-extra set-partial-uri-extra!))
-(set-record-type-unparser-method! <partial-uri>
+(define-unparser-method partial-uri?
(standard-unparser-method 'PARTIAL-URI
(lambda (puri port)
(write-char #\space port)
(define-guarantee rdf-bnode "RDF bnode")
-(set-record-type-unparser-method! <rdf-bnode>
+(define-unparser-method rdf-bnode?
(standard-unparser-method 'RDF-BNODE
(lambda (bnode port)
(write-char #\space port)
(and (not (absolute-uri? type))
type)))
-(set-record-type-unparser-method! <rdf-literal>
+(define-unparser-method rdf-literal?
(standard-unparser-method 'RDF-LITERAL
(lambda (literal port)
(write-char #\space port)
(qname combo-name-qname)
(expanded combo-name-expanded))
-(set-record-type-unparser-method! <combo-name>
+(define-unparser-method combo-name?
(simple-unparser-method 'XML-NAME
(lambda (name)
(list (combo-name-qname name)))))
(indent-attributes? ctx-indent-attributes?)
(indent-dtd? ctx-indent-dtd?))
-(set-record-type-unparser-method! <ctx>
+(define-unparser-method ctx?
(standard-unparser-method 'xml-output-context #f))
(define (emit-char char ctx)
(let ((name (cadr form))
(accessor (caddr form)))
(let ((root (symbol 'XML- name)))
- `(SET-RECORD-TYPE-UNPARSER-METHOD!
- ,(close-syntax (symbol '< root '>) environment)
+ `(define-unparser-method
+ ,(close-syntax (symbol root '?) environment)
(SIMPLE-UNPARSER-METHOD ',root
(LAMBDA (,name)
(LIST (,(close-syntax accessor environment) ,name)))))))