This is a simple macro I use to make transactions feel like apart of the Nemerle language.
Watch the Screencast
using System;
using System.Transactions;
namespace Demo
{
module Program
Main() : void
using (trans = TransactionScope())
// Do some stuff in a transaction
// ...
// Remember to call Complete when finished!
trans.Complete();
}
using SampleMacros;
transaction
namespace SampleMacros
public macro transaction(block) syntax ("transaction", block)
<[
using (t = TransactionScope()) {
$block;
t.Complete();
]>
Powered by: newtelligence dasBlog 2.2.8279.16125
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2010, Andrew Davey
E-mail