anchor.diff:  %%% Helper functions
   %%%----------------------------------------------------------------------------
   
  +%% Generates a random stock symbol
   random_symbol() ->
       CharPool = "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
       LenPool = [1, 2, 3, 4],
  -    Symbol = [choice(CharPool) || S <- lists:seq(1, choice(LenPool))],
  +    Symbol = for(1, choice(LenPool), fun() -> choice(CharPool) end),
       Symbol.
   
   
  +%% Generates a random price
   random_price() ->
       DigPool = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
       LenPool = [1, 2, 3],
   
  -    Dollars = [
  -        integer_to_list(choice(DigPool)) ||
  -        S <- lists:seq(1, choice(LenPool))
  -    ],
  +    Dollars = for(1, choice(LenPool),
  +        fun() -> integer_to_list(choice(DigPool)) end
  +    ),
   
  -    Cents = [
  -        integer_to_list(choice(DigPool)) ||
  -        S <- lists:seq(1, 2)
  -    ],
  +    Cents = for(1, 2,
  +        fun() -> integer_to_list(choice(DigPool)) end
  +    ),
   
       Price = string:join(
           [string:join(Dollars, ""), string:join(Cents, "")],
  
positive.code:     MaxListings = 5,
      MaxBrokers = 3,
      Listings = sets:to_list(sets:from_list(
          [random_symbol() || Stock <- lists:seq(1, MaxListings)]
      )),
  
      register(ticker, spawn(market, ticker, [])),
  
negative.code:     Maximum = length(List),
      Element = random:uniform(Maximum),
      lists:nth(Element, List).
  
  
  %% Repeat Function(), Max times, accumulating a list of its return values
  for(Max, Max, Function) ->
      [Function()];
  
  for(Init, Max, Function) ->
      [Function() | for(Init + 1, Max, Function)].
  