ResultStyle.ITERABLE_LIST_MUTABLELIST,
calc.getResultStyle());
}
} else if (TypeUtil.couldBeMember(type)) {
final MemberCalc memberCalc = compiler.compileMember(arg);
final ResolvedFunCall call = wrapAsSet(arg);
return new AbstractMemberIterCalc(call, new Calc[] {memberCalc}) {
public Iterable<Member> evaluateMemberIterable(
Evaluator evaluator)
{
final Member member =
memberCalc.evaluateMember(evaluator);
return new Iterable<Member>() {
public Iterator<Member> iterator() {
return new Iterator<Member>() {
private Member m = member;
public boolean hasNext() {
return (m != null);
}
public Member next() {
try {
return m;
} finally {
m = null;
}
}
public void remove() {
throw new UnsupportedOperationException(
"remove");
}
};
}
};
}
protected String getName() {
return "Sublist";
}
};
} else {
final TupleCalc tupleCalc = compiler.compileTuple(arg);
final ResolvedFunCall call = wrapAsSet(arg);
return new AbstractTupleIterCalc(call, new Calc[] {tupleCalc}) {
public Iterable<Member[]> evaluateTupleIterable(
Evaluator evaluator)
{
final Member[] members = tupleCalc.evaluateTuple(evaluator);