It gets even better.
If you know in advance some of the strategies your callers might want to pursue in dealing with an error, you can name those strategies at the point of a possible error, and then let callers select a strategy by name. The bind-continue form takes the name of a strategy, an argument list, and a form to implement the strategy.
So, continuing with our log example, you might choose to provide explicit skip and log strategies for dealing with a parse error:
|||(defn parse-or-continue [logseq]|
|||(with-handler (parse-log-entry entry)|
|||(bind-continue skip [msg]|
|||(bind-continue log [msg]|
|||(println "****invalid log: " msg))))]|
|||(vec (map parse-log-entry ...|