[erlang-questions] A style question

Vance Shipley <>
Sat Feb 13 19:55:42 CET 2010


In my personal style I only use an inline fun() when it is
short enough to fit on one line:

   case mnesia:transaction(fun() -> mnesia:all_keys(funky) end) of
       {atomic, Keys} ->
           ...
       {aborted, Reason} ->
           ...
   end

Otherwise seperating the transaction logic itself from the
transaction result handling is more clear.

	-Vance

On Fri, Feb 12, 2010 at 05:34:52PM +1300, Richard O'Keefe wrote:
}  My preferred style for this would be
}  
}  	mnesia:transaction(fun () ->
}  	    ....
}  	end)

-- 
	-Vance


More information about the erlang-questions mailing list