Le lun. 22 avr. 2019 à 20:39, John Cowan <xxxxxx@ccil.org> a écrit :

A more Schemey approach would be (in-transaction database proc failure success), which evaluates proc passing a newly created transaction as its argument.
 
When proc returns, the transaction is committed and in-transaction applies whatever proc returned to the success procedure and returns its result.
 
If proc calls "rollback" instead,

How does look the definition of that "rollback"? Isn't it a raise of some sort?
 
then the transaction is rolled back, the execution of proc is abandoned, failure is called with no arguments, and in-transaction returns its result.  By default failure is "raise" and success is "identity".

I will add `in-transaction` but as `transactional`, i prefer that naming, in SRFI 167 with the behavior you described and update `transactional` in SRFI 168 to be similar.