public static RAny genericUpdate(RArray base, int pos, RAny value, boolean subset, ASTNode ast) {
// FIXME: avoid some copying here but careful about lists
RArray typedBase;
Object rawValue;
int[] dimensions = base.dimensions();
Names names = base.names();
if (value instanceof RList) { // FIXME: this code gets copied around a few times, could it be refactored without a performance penalty?
if (base instanceof RList) {
typedBase = base;
} else {