.TH Sum .PP Arithmetic sum .SH Signature .PP .RS .nf sum(expr: AttrName|(Tuple->Numeric)) -> Aggregator .fi .RE .SH Examples .PP .RS .nf sum(:qty) .fi .RE .PP .RS .nf sum{|t| t.qty * t.price } .fi .RE .PP .RS .nf sum(->(t){ t.qty * t.price }) .fi .RE .SH Description .PP Computes \fB\fCv1 + v2 + ... + vn\fR\&. .SH Implementation notes .PP This aggregate function should only be used with numeric types. As of current Alf version, it does not aggregate empty sets correctly on non\-numeric data types.