Le mar. 23 avr. 2019 à 13:11, Amirouche Boubekki <xxxxxx@gmail.com> a écrit :

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".


Can you give more hints on how the implementation of in-transaction looks like? In particular about rollback is implemented.

 
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.

Actually that is a bad idea since transactional and in-transaction are much different.


Best regards,


Amirouche