(zilch planner step): add (build-plan-next-id)
This commit is contained in:
parent
930e9f6b15
commit
c23a039972
1 changed files with 9 additions and 2 deletions
|
|
@ -8,6 +8,8 @@
|
||||||
register-build-step
|
register-build-step
|
||||||
|
|
||||||
empty-build-plan build-plan-print build-plan-tick
|
empty-build-plan build-plan-print build-plan-tick
|
||||||
|
build-plan-next-id
|
||||||
|
|
||||||
build-plan-current-plan
|
build-plan-current-plan
|
||||||
|
|
||||||
build-plan-append build-plan-tail-call build-plan-return-append)
|
build-plan-append build-plan-tail-call build-plan-return-append)
|
||||||
|
|
@ -40,10 +42,15 @@
|
||||||
(define (empty-build-plan)
|
(define (empty-build-plan)
|
||||||
(make-build-plan (mapping (make-default-comparator)) '() (mapping (make-default-comparator)) 0))
|
(make-build-plan (mapping (make-default-comparator)) '() (mapping (make-default-comparator)) 0))
|
||||||
|
|
||||||
;; Appends a new step to the build plan, returning its ID.
|
;; Returns a monotonically-increasing identifier for this build plan.
|
||||||
(define (build-plan-append plan type args dependencies)
|
(define (build-plan-next-id plan)
|
||||||
(define id (+ (build-plan-last-id plan) 1))
|
(define id (+ (build-plan-last-id plan) 1))
|
||||||
(set-build-plan-last-id! plan id)
|
(set-build-plan-last-id! plan id)
|
||||||
|
id)
|
||||||
|
|
||||||
|
;; Appends a new step to the build plan, returning its ID.
|
||||||
|
(define (build-plan-append plan type args dependencies)
|
||||||
|
(define id (build-plan-next-id plan))
|
||||||
(define new-step (make-build-step id dependencies type args))
|
(define new-step (make-build-step id dependencies type args))
|
||||||
(set-build-plan-steps! plan (mapping-set! (build-plan-steps plan) id new-step))
|
(set-build-plan-steps! plan (mapping-set! (build-plan-steps plan) id new-step))
|
||||||
id)
|
id)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue