(list-transform-positive (pmodel/extra-packages pmodel)
(lambda (package)
(or (there-exists? (package/links package) link/new?)
- (there-exists? (package/sorted-bindings package)
- new-internal-binding?)))))
+ (there-exists? (package/bindings package) new-internal-binding?)))))
(define (new-internal-binding? binding)
(and (binding/new? binding)
'())))
(list->vector
(map binding/name
- (list-transform-positive (package/sorted-bindings package)
+ (list-transform-positive (package/bindings package)
new-internal-binding?)))
(list->vector
(map (lambda (link)
(let ((free-references
(append-map! (lambda (package)
(delete-matching-items
- (package/sorted-references package)
+ (package/references package)
reference/binding))
packages)))
(if (pair? free-references)
(classify-bindings-by-package
(lambda (binding)
(binding/package (binding/source-binding binding)))
- (package/sorted-bindings package))))
+ (package/bindings package))))
(let ((class (assq package classes)))
(if class
(format-package/bindings port indentation width package (cdr class)))
(for-each (lambda (class)
(if (not (eq? package (car class)))
(format-package/imports port indentation width package
- (car class)
- (cdr class))))
+ (car class) (cdr class))))
classes)
(if class
(for-each
(lambda (class)
(if (not (eq? package (car class)))
- (format-package/exports port indentation width (car class)
- (sort (cdr class) binding<?))))
+ (format-package/exports port indentation width
+ (car class) (cdr class))))
(classify-bindings-by-package
binding/package
(append-map (lambda (binding)
(set! unlinked (cons value-cell unlinked)))
((not (memq value-cell linked))
(set! linked (cons value-cell linked))))))
- (package/sorted-bindings package)))
+ (package/bindings package)))
packages)
(values unlinked linked)))
\f
(binding->name binding)
(append-map reference/expressions
(binding/references binding))))
- bindings))
+ (sort bindings binding<?)))
(define (classify-bindings-by-package binding->package bindings)
(let ((classes '()))
(set-cdr! entry (cons binding (cdr entry)))
(set! classes (cons (list package binding) classes))))))
bindings)
- (for-each (lambda (class)
- (set-cdr! class (reverse! (cdr class))))
- classes)
(sort classes
(lambda (x y)
(package<? (car x) (car y))))))
(files '())
parent
(children '())
- (bindings (make-strong-eq-hash-table) read-only #t)
- (references (make-strong-eq-hash-table) read-only #t)
+ (%bindings (make-strong-eq-hash-table) read-only #t)
+ (%references (make-strong-eq-hash-table) read-only #t)
(links '()))
(define-integrable (package/n-files package)
(null? (package/name package)))
(define-integrable (package/find-reference package name)
- (hash-table/get (package/references package) name #f))
+ (hash-table/get (package/%references package) name #f))
(define-integrable (package/put-reference! package name reference)
- (hash-table/put! (package/references package) name reference))
+ (hash-table/put! (package/%references package) name reference))
(define-integrable (package/find-binding package name)
- (hash-table/get (package/bindings package) name #f))
+ (hash-table/get (package/%bindings package) name #f))
(define-integrable (package/put-binding! package name binding)
- (hash-table/put! (package/bindings package) name binding))
+ (hash-table/put! (package/%bindings package) name binding))
-(define-integrable (package/sorted-bindings package)
- (sort (hash-table/datum-list (package/bindings package))
- binding<?))
+(define-integrable (package/bindings package)
+ (hash-table/datum-list (package/%bindings package)))
-(define-integrable (package/sorted-references package)
- (sort (hash-table/datum-list (package/references package))
- reference<?))
+(define-integrable (package/references package)
+ (hash-table/datum-list (package/%references package)))
(define-integrable (file-case/type file-case)
(car file-case))
(define (resolve-references! pmodel)
(for-each (lambda (package)
(for-each resolve-reference!
- (package/sorted-references package)))
+ (package/references package)))
(pmodel/packages pmodel)))
(define (resolve-reference! reference)