applyTable(T, f)
i1 : t = table({1,3,5,7}, {0,1,2,4}, (i,j) -> i^j);
i2 : netList t +-+-+--+----+ o2 = |1|1|1 |1 | +-+-+--+----+ |1|3|9 |81 | +-+-+--+----+ |1|5|25|625 | +-+-+--+----+ |1|7|49|2401| +-+-+--+----+
i3 : netList applyTable(t, i -> 2*i) +-+--+--+----+ o3 = |2|2 |2 |2 | +-+--+--+----+ |2|6 |18|162 | +-+--+--+----+ |2|10|50|1250| +-+--+--+----+ |2|14|98|4802| +-+--+--+----+
i4 : netList applyTable(t, isPrime) +-----+-----+-----+-----+ o4 = |false|false|false|false| +-----+-----+-----+-----+ |false|true |false|false| +-----+-----+-----+-----+ |false|true |false|false| +-----+-----+-----+-----+ |false|true |false|false| +-----+-----+-----+-----+
The object applyTable is a function closure.