forked from DGNum/liminix
replace var/each with accumulate
This commit is contained in:
parent
8f97c5bf3c
commit
3bdb7754d3
1 changed files with 3 additions and 4 deletions
|
@ -31,14 +31,13 @@
|
|||
new-addresses))
|
||||
|
||||
(fn run []
|
||||
(var addresses [])
|
||||
(let [[state-directory wan-device] arg
|
||||
dir (svc.open state-directory)]
|
||||
(each [v (dir:events)]
|
||||
(accumulate [addresses []
|
||||
v (dir:events)]
|
||||
;; we don't handle unbound or stopped, where we should
|
||||
;; take the addresses away
|
||||
(when (. bound-states (v:output "state"))
|
||||
(set addresses
|
||||
(update-addresses wan-device addresses (v:output "address")))))))
|
||||
(update-addresses wan-device addresses (v:output "address"))))))
|
||||
|
||||
{ : update-addresses : changes : run }
|
||||
|
|
Loading…
Reference in a new issue