networks: Rewrite update.
This commit is contained in:
parent
6560dcbe6c
commit
11d75bcc89
1 changed files with 3 additions and 4 deletions
|
@ -181,10 +181,9 @@
|
|||
|
||||
;;; Given a state s updates all the variables from xs.
|
||||
(define (update network s xs)
|
||||
(for/fold ([new-s s])
|
||||
([x xs])
|
||||
(let ([f (hash-ref network x)])
|
||||
(hash-set new-s x (f s)))))
|
||||
(define funcs (network-functions network))
|
||||
(for/hash ([x xs])
|
||||
(x ((hash-ref funcs x) s))))
|
||||
|
||||
(module+ test
|
||||
(test-case "basic definitions"
|
||||
|
|
Loading…
Reference in a new issue