Commits

Fred T-H  committed 5735c29 Draft

spaces after commas

  • Participants
  • Parent commits c65c76a

Comments (0)

Files changed (5)

File discrep1.erl

 
 run() -> some_op(5, you).
 
-some_op(A,B) -> A + B.
+some_op(A, B) -> A + B.

File discrep2.erl

 count({give, Num, _}) -> Num.
 account({give, _, X}) -> X.
 
-some_op(A,B) -> A + B.
+some_op(A, B) -> A + B.

File discrep3.erl

 
 run() ->
     Tup = money(5, you),
-    some_op(item(count,Tup), item(account,Tup)).
+    some_op(item(count, Tup), item(account, Tup)).
 
 money(Num, Name) -> {give, Num, Name}.
 
 item(count, {give, X, _}) -> X;
 item(account, {give, _, X}) -> X.
 
-some_op(A,B) -> A + B.
+some_op(A, B) -> A + B.
 

File fifo_types.erl

 -export([new/0, push/2, pop/1, empty/1]).
 -export([test/0]).
 
--spec new() -> {fifo,[],[]}.
+-spec new() -> {fifo, [], []}.
 new() -> {fifo, [], []}.
 
 -spec push({fifo, In::list(), Out::list()}, term()) -> {fifo, list(), list()}.
 %-spec empty({fifo, [], []}) -> true;
 %           ({fifo, list(), list()}) -> false.
 -spec empty({fifo, [], []}) -> true;
-           ({fifo, [any(),...], [any(),...]}) -> false.
+           ({fifo, [any(), ...], [any(), ...]}) -> false.
 empty({fifo, [], []}) -> true;
 empty({fifo, _, _}) -> false.
 
 test() ->
     N = new(),
-    {2,N2} = pop(push(push(new(), 2), 5)),
-    {5,N3} = pop(N2),
+    {2, N2} = pop(push(push(new(), 2), 5)),
+    {5, N3} = pop(N2),
     N = N3,
     true = empty(N3),
     false = empty(N2),
     %pop({fifo, [a|b], [e]}).
-    pop({fifo, [a,b], [e]}).
+    pop({fifo, [a, b], [e]}).
             (squid) -> food(squid()).
 feeder(red_panda) ->
     F = fun(_) ->
-        element(random:uniform(4), {bamboo,birds,eggs,berries})
+        element(random:uniform(4), {bamboo, birds, eggs, berries})
     end,
     stream:make(F, red_panda);
 feeder(squid) ->
 
 main() ->
     <<A:32, B:32, C:32>> = crypto:rand_bytes(12),
-    random:seed(A,B,C),
+    random:seed(A, B, C),
     %% The Zoo bought red pandas!
     FeederRP = feeder(red_panda),
     feed(red_panda, FeederRP),