mathstodon.xyz is one of the many independent Mastodon servers you can use to participate in the fediverse.
A Mastodon instance for maths people. We have LaTeX rendering in the web interface!

Server stats:

2.8K
active users

#functions

3 posts3 participants0 posts today

We use scalasql at work (yes, I'd recommend) and we had a bug where we mistakenly created nested transactions (which scalasql doesn't support -- but it does support savepoints).

Anyway, we found a clever way to statically prevent nesting transactions using macros, which I thought I'd share as an illustration of the helpfulness of macros
gist.github.com/aboisvert/c716

Illustration of using Scala macro to statically prevent nested transactions using the scalasql library - preventNestedTransaction.scala
GistIllustration of using Scala macro to statically prevent nested transactions using the scalasql libraryIllustration of using Scala macro to statically prevent nested transactions using the scalasql library - preventNestedTransaction.scala