Re: Evaluation of aggregates

On 20/09/10 11:30, Axel Polleres wrote:
>> >  Just define:
>> >  Sum(S) = op:numeric-add(S0, Sum(S1..n)) when|S|  >  1 if S0 is a number
>> >  Sum(S) = op:numeric-add(0, Sum(S1..n)) when|S|  >  1 if S0 is not a number
> is not as straightforward as Flatten op:numeric-add, but could be an option.
>

I don't understand that. The flatten operation is independent of the 
specific aggregation - it doesn't remove non-numbers:

[[
Definition: Flatten

The Flatten(M) function takes a multiset of lists, M {(L1, L2, ...), 
...}, and returns the multiset given by the multiset union of { Li | L 
in M } for all i in L.
]]

Could be changed to take a condition on the members produced.

Avg() works if Sum() does.

	Andy

Received on Monday, 20 September 2010 13:24:14 UTC