UnwashedMeme / clsql

Several branches containing different patches, see the wiki for branch descriptions
Other
20 stars 12 forks source link

Give WITH-TRANSACTION a convenience return-value #13

Open tdrhq opened 4 years ago

tdrhq commented 4 years ago

Simple stuff, just a little bit of added convenience.

kmcgivney commented 1 year ago

I don't understand the difference between this approach and the prog2 that's there now. prog2 returns the second form right?

I think what we also need here is to allow the user to return multiple values. prog2 can't return multiple values.

Awkward though it might look the way to do it may be

(progn
  (database-start-transaction ,db)
  (multiple-value-prog1
    (progn
      ,@body)
    (mark-transaction-committed ,db)))