diff --git a/rs-tests.rkt b/rs-tests.rkt index d25b355..2c0ae5b 100644 --- a/rs-tests.rkt +++ b/rs-tests.rkt @@ -81,4 +81,5 @@ (list (set 'y) (set 'y 'z)) (list (set 'z) (set)) (list (set) (set)) - (list (set 'z) (set)))))) + (list (set 'z) (set)) + (list (set) (set)))))) diff --git a/rs.rkt b/rs.rkt index 7b6a855..03a8462 100644 --- a/rs.rkt +++ b/rs.rkt @@ -178,13 +178,15 @@ ;;; sequence. The output is a list of pairs of lists in which the ;;; first element is the current context and the second element is the ;;; result of the application of reactions to the previous state. The -;;; interactive process stops when there are no more contexts left. +;;; interactive process stops one step after the end of the context +;;; sequence, to show the effect of the last context. (define (build-interactive-process rs contexts) - (let ([dyn (dynamics rs)]) + (let ([dyn (dynamics rs)] + [padded-contexts (append contexts (list (set)))]) (for/fold ([proc '()] - [st (state (set) contexts)] + [st (state (set) padded-contexts)] #:result (reverse proc)) - ([c contexts]) + ([c padded-contexts]) (values (cons (match st [(state res ctx)