} else if (ref instanceof Iterator) {
iterator = (Iterator)ref;
} else if (ref instanceof Iterable) {
iterator = ((Iterable)ref).iterator();
} else if (ref.getClass().isArray()) {
iterator = new ArrayListAdapter(ref).iterator();
} else if (ref instanceof Map) {
iterator = new MapListAdapter((Map)ref).iterator();
} else {
throw new InterpretationException(source, indexInSource, "Can not iterate over a " + ref.getClass().getCanonicalName());
}