anchor.diff:  % atc872.erl
   %
  -% Server for the ATC872 low-maintenance online chat forum service.
  -
  +% Server for the ATC872 online forum service.
  +%
   % Copyright (c) 2013, Chris Bristow
   % All rights reserved.
   % 
  
positive.code:     { atomic, _ } ->
        ok
    end.
  
negative.code:       ;
      [] ->
        no_such_channel
    end.
  
  
  
  
  get_a_row(Result, Channel, CurrentRow, FirstRow, RowsBack) ->
    if
      CurrentRow == FirstRow ->
        Result
        ;
      length(Result) >= RowsBack ->
        Result
        ;
      true ->
        case mnesia:read({ rows, { node(), Channel, CurrentRow } }) of
          [ { _, _, R } ] ->
            get_a_row([ R ] ++ Result, Channel, CurrentRow - 1, FirstRow, RowsBack)
            ;
          _ ->
            Result
        end
    end.
  
  
  