Skip to content

Commit

Permalink
Factor out the processing of coordinate pairs from SPROUTS-LOOP
Browse files Browse the repository at this point in the history
  • Loading branch information
karalekas committed Nov 10, 2023
1 parent 8c36dea commit 1435907
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/dryad.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,15 @@ NOTE: In the basic implementation, these messages must be waiting for the DRYAD
(push ids pairs))
(t
(error "Two distinct match edges laid claim to the same vertex.")))))
(assert (= (length pairs) (/ (length addresses) 2)))
(dolist (pair pairs)
(send-message (dryad-match-address dryad)
(make-message-reap :ids pair)))
(process-continuation dryad `(WIND-DOWN)))))))
(process-continuation dryad
`(PROCESS-PAIRS ,pairs)
`(WIND-DOWN)))))))

(define-process-upkeep ((dryad dryad) now) (PROCESS-PAIRS pairs)
"Iterates through `PAIRS' and sends corresponding REAP messages."
(dolist (pair pairs)
(send-message (dryad-match-address dryad)
(make-message-reap :ids pair))))

(define-process-upkeep ((dryad dryad) now) (SEND-EXPAND sprout)
"Directs SPROUT to perform blossom expansion."
Expand Down

0 comments on commit 1435907

Please sign in to comment.