Le ven. 26 avr. 2019 à 17:19, Amirouche Boubekki <xxxxxx@gmail.com> a écrit :


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

Alex Miller from FoundationDB made some feedback about srfi-167 and he propose something similar to in-transaction.

I will think more about it but I think I will adopt in-transaction.

ref: https://forums.foundationdb.org/t/scheme-request-for-implementation/1416/2?u=amirouche