grab a value in list for later use in map

Wes James <>
Thu Jun 3 06:37:17 CEST 2010


With a map such as this:

map(fun(Row) ->
                     {tr, [],
                      [{td, [], massage(W)} || W <- Row]
                     }
         	end, Rows)

It outputs values like this:

4	 6183	 2010-05-20
0	 6193	 2010-05-21
6	 6209	 2010-05-24

But if there is a 0 in the first column, I want to instead of
outputting the 0, subtract the column to the right value - previous
column value, i.e subtract 6193-6183.  How do I keep a second column
value around if I need it like this with map?

thx,

-wes


More information about the erlang-questions mailing list