semantic: foreaching aggregates add nested function.