private final Object castToAndClone(PageContext pc,FunctionArgument arg,Object value, int index) throws PageException {
//if(value instanceof Array)print.out(count++);
if(Decision.isCastableTo(arg.getType(),arg.getTypeAsString(),value))
return arg.isPassByReference()?value:Duplicator.duplicate(value,false);
throw new UDFCasterException(this,arg,value,index);
//REALCAST return Caster.castTo(pc,arg.getType(),arg.getTypeAsString(),value);
}