(define (ex:unique-token) (number->string (current-seconds)))
(define ex:undefined (letrec ((x y) (y #f)) x))
(define ex:undefined-set! 'set!)
(define ex:guid-prefix "&")
(define ex:free-prefix "~")
(define assertion-violation
(lambda args
(display 'assertion-violation)
(newline)
(for-each pretty-print args)
(newline)
(error)))
(define (memp proc ls)
(cond ((null? ls) #f)
((pair? ls) (if (proc (car ls))
ls
(memp proc (cdr ls))))
(else (assertion-violation 'memp "Invalid argument" ls))))
(define for-all andmap)
(define (make-record-type-descriptor name parent uid sealed? opaque? fields)
(call-with-values
(lambda () (make-struct-type name #f (vector-length fields) 0))
(lambda (type-descriptor
full-constructor
predicate
generic-access
generic-mutate)
(list type-descriptor
full-constructor
predicate
generic-access
generic-mutate))))
(define (make-record-constructor-descriptor rtd parent-constructor-descriptor protocol)
rtd)
(define (record-constructor cd) (cadr cd))
(define (record-predicate rtd) (caddr rtd))
(define (record-accessor rtd k)
(let ((generic-access (cadddr rtd)))
(lambda (r) (generic-access r k))))