(defn add-block
"Adds a new block, returns its id, but does not change the current block (does not call set-block)."
[]
(gen-plan
[_ (update-in-plan [:block-id] (fnil inc 0))
blk-id (get-in-plan [:block-id])
cur-blk (get-block)
_ (assoc-in-plan [:blocks blk-id] [])
catches (get-binding :catch)
_ (assoc-in-plan [:block-catches blk-id] catches)
_ (if-not cur-blk
(assoc-in-plan [:start-block] blk-id)
(no-op))]
blk-id))