receive statement in Erlang

Vance Shipley <>
Thu May 17 11:13:28 CEST 2001


Sean Hinde writes:
>
> I really don't think it is possible to nicely format Erlang code without
> using spaces. What about:
>
> function_with_lots_of_parameters(Param1, Param2, Parameter_with_long_name,
> 					   Another_long_parameter,
> Final_parameter) ->


I use the rule that if it's being continued it's one stop more than if
it were the next line:

function_with_lots_of_parameters(Param1, Param2, Parameter_with_long_name,
		Another_long_parameter, And_yet_another, And_another,
		And_another_long_parameter, And_yet_another, And_another,
		And_one_more) ->
	foo(Param1),
	foo(Param2),


That works for me.  It's simply beautiful to see when all your code
changes to fit with one command (changing the tabstops in the editor).
If the code is simple leave the tabs at 8.  If it get's to long and
indented many times than change to tabs=5 or even 1 if neccesary.

Now before someone else says it; yes it's probably time for another
function by then but I'd say sometime after tabs=5 anyway.  (I use 3).

	-Vance




More information about the erlang-questions mailing list