Yes yes yes! I like this! Both for transactions (which I'd like to
implement too) and for other new control constructs. This would be great
for threads programming, too:
exec AttemptShare(some_object): # or any of {Attempt|Obtain}{Lock|Share}
# do stuff with the locked entity
# lock automaticly freed at end of block
else:
# something else
As with transactions it could be done with existing facilities, but it's
easy to screw up handling of freeing the lock, especially in the case of
exceptions and what not.
This is a really sexy construct, and it sure would get my vote.
-- Ty Sarna "Don't be wet or humidity, for the cause of tsarna@endicor.com electric obstacle." -- Warning from a manual