[MUD-Dev] Re: atomic functions

Jon A. Lambert jlsysinc at ix.netcom.com
Wed May 13 17:47:10 CEST 1998


On  7 May 98, Shawn Halpenny wrote:
> Simplistic example:
> 
> function SetMaxDamage(n)
> {
> 	if (n < 0)
> 		throw out_of_range
> 
> 	max_damage = n
> }
>

In my model, such an event would fail and any changes would not be 
committed.

However:

function SetMaxDamage(n)
{
	if (n < 0)
		throw out_of_range

	max_damage = n
	catch(out_of_range) {}
}

would succeed in commiting!

--
--/*\ Jon A. Lambert - TychoMUD     Internet:jlsysinc at ix.netcom.com /*\--
--/*\ Mud Server Developer's Page <http://www.netcom.com/~jlsysinc> /*\--
--/*\   "Everything that deceives may be said to enchant" - Plato   /*\--

--
MUD-Dev: Advancing an unrealised future.



More information about the mud-dev-archive mailing list