      static double mp_da_insert_or_push(_cimg_math_parser& mp) {
        const char *const s_op = mp.opcode[3]==~0U?"da_push":"da_insert";
        mp_check_list(mp,s_op);
        const unsigned int
          dim = (unsigned int)mp.opcode[4],
          _dim = std::max(1U,dim),
          nb_elts = (unsigned int)mp.opcode[5] - 6,
          ind = (unsigned int)cimg::mod((int)_mp_arg(2),mp.imglist.width());
        CImg<T> &img = mp.imglist[ind];
        const int
          siz = img?(int)img[img._height - 1]:0,
          pos0 = mp.opcode[3]==~0U?siz:(int)_mp_arg(3),
          pos = pos0<0?pos0 + siz:pos0;

        if (img && _dim!=img._spectrum)
          throw CImgArgumentException("[" cimg_appname "_math_parser] CImg<%s>: Function '%s()': "
                                      "Element to insert has invalid size %u (should be %u).",
                                      mp.imgout.pixel_type(),s_op,_dim,img._spectrum);
        if (img && (img._width!=1 || img._depth!=1 || siz<0 || siz>img.height() - 1))
          throw CImgArgumentException("[" cimg_appname "_math_parser] CImg<%s>: Function '%s()': "
                                      "Specified image (%d,%d,%d,%d) cannot be used as dynamic array%s.",
                                      mp.imgout.pixel_type(),s_op,img.width(),img.height(),img.depth(),img.spectrum(),
                                      img._width==1 && img._depth==1?"":" (contains invalid element counter)");
        if (pos<0 || pos>siz)
          throw CImgArgumentException("[" cimg_appname "_math_parser] CImg<%s>: Function '%s()': "
                                      "Invalid position %d (not in range -%d...%d).",
                                      mp.imgout.pixel_type(),s_op,pos0,siz,siz);

        if (siz + nb_elts + 1>=img._height) // Increase size of dynamic array, if necessary
          img.resize(1,2*siz + nb_elts + 1,1,_dim,0);

        if (pos!=siz) // Move existing data in dynamic array
          cimg_forC(img,c) std::memmove(img.data(0,pos + nb_elts,0,c),img.data(0,pos,0,c),(siz - pos)*sizeof(T));

        if (!dim) // Scalar or vector1() elements
          for (unsigned int k = 0; k<nb_elts; ++k) img[pos + k] = (T)_mp_arg(6 + k);
        else // vectorN() elements, with N>1
          for (unsigned int k = 0; k<nb_elts; ++k) {
            double *ptrs = &_mp_arg(6 + k) + 1;
            cimg_forC(img,c) img(0,pos + k,0,c) = ptrs[c];
          }
        img[img._height - 1] = (T)(siz + nb_elts);
        return cimg::type<double>::nan();
      }
      static double mp_da_insert_or_push(_cimg_math_parser& mp) {
        const char *const s_op = mp.opcode[3]==~0U?"da_push":"da_insert";
        mp_check_list(mp,s_op);
        const unsigned int
          dim = (unsigned int)mp.opcode[4],
          _dim = std::max(1U,dim),
          nb_elts = (unsigned int)mp.opcode[5] - 6,
          ind = (unsigned int)cimg::mod((int)_mp_arg(2),mp.imglist.width());
        CImg<T> &img = mp.imglist[ind];
        const int
          siz = img?(int)img[img._height - 1]:0,
          pos0 = mp.opcode[3]==~0U?siz:(int)_mp_arg(3),
          pos = pos0<0?pos0 + siz:pos0;

        if (img && _dim!=img._spectrum)
          throw CImgArgumentException("[" cimg_appname "_math_parser] CImg<%s>: Function '%s()': "
                                      "Element to insert has invalid size %u (should be %u).",
                                      mp.imgout.pixel_type(),s_op,_dim,img._spectrum);
        if (img && (img._width!=1 || img._depth!=1 || siz<0 || siz>img.height() - 1))
          throw CImgArgumentException("[" cimg_appname "_math_parser] CImg<%s>: Function '%s()': "
                                      "Specified image (%d,%d,%d,%d) cannot be used as dynamic array%s.",
                                      mp.imgout.pixel_type(),s_op,img.width(),img.height(),img.depth(),img.spectrum(),
                                      img._width==1 && img._depth==1?"":" (contains invalid element counter)");
        if (pos<0 || pos>siz)
          throw CImgArgumentException("[" cimg_appname "_math_parser] CImg<%s>: Function '%s()': "
                                      "Invalid position %d (not in range -%d...%d).",
                                      mp.imgout.pixel_type(),s_op,pos0,siz,siz);

        if (siz + nb_elts + 1>=img._height)  
          img.resize(1,2*siz + nb_elts + 1,1,_dim,0);

        if (pos!=siz)  
          cimg_forC(img,c) std::memmove(img.data(0,pos + nb_elts,0,c),img.data(0,pos,0,c),(siz - pos)*sizeof(T));

        if (!dim)  
          for (unsigned int k = 0; k<nb_elts; ++k) img[pos + k] = (T)_mp_arg(6 + k);
        else  
          for (unsigned int k = 0; k<nb_elts; ++k) {
            double *ptrs = &_mp_arg(6 + k) + 1;
            cimg_forC(img,c) img(0,pos + k,0,c) = ptrs[c];
          }
        img[img._height - 1] = (T)(siz + nb_elts);
        return cimg::type<double>::nan();
      }