diff --git a/planner/src/step.sld b/planner/src/step.sld index f4db2f5..a7e3608 100644 --- a/planner/src/step.sld +++ b/planner/src/step.sld @@ -8,6 +8,8 @@ register-build-step empty-build-plan build-plan-print build-plan-tick + build-plan-next-id + build-plan-current-plan build-plan-append build-plan-tail-call build-plan-return-append) @@ -40,10 +42,15 @@ (define (empty-build-plan) (make-build-plan (mapping (make-default-comparator)) '() (mapping (make-default-comparator)) 0)) - ;; Appends a new step to the build plan, returning its ID. - (define (build-plan-append plan type args dependencies) + ;; Returns a monotonically-increasing identifier for this build plan. + (define (build-plan-next-id plan) (define id (+ (build-plan-last-id plan) 1)) (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)) (set-build-plan-steps! plan (mapping-set! (build-plan-steps plan) id new-step)) id)