GNU bug report logs -
#67142
29.1; with-sqlite-transaction commits on exception rather than rolling back
Previous Next
Reported by: Vasilij Schneidermann <mail <at> vasilij.de>
Date: Mon, 13 Nov 2023 00:49:01 UTC
Severity: normal
Found in version 29.1
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #20 received at 67142 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
> > I don't understand this part, sorry. Why do we need a symbol to
> > return the result of the body?
>
> db-var and func-var are uninterned symbols in the macro expansion but
> the variables 'result' and 'commit' marked below aren't. If the intent
> is not to expose these variables to the macro's BODY, the inner let
> should also uninterned symbols right?
Correct, this is what I was hinting at. As annoying as it is, when
writing unhygienic macros one should use uninterned symbols to avoid
exposing additional variables to the BODY argument.
Alternatively, the pattern of `(let ((return (...))) ... return)` can be
replaced with `(prog1 (...) ...)`.
@Eli: The new patch looks better and closer to how the issue is solved
in the Ruby sqlite3 gem. I'm still not sure about this use of
`unwind-protect` being correct, but it does preserve the backtrace in
case of an error better than when I used `(condition-case e (...) (error
(apply #'signal e)))`.
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 1 year and 72 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.