diff --git a/src/builtins/md1.c b/src/builtins/md1.c index 730e6f53..9286a99e 100644 --- a/src/builtins/md1.c +++ b/src/builtins/md1.c @@ -315,6 +315,8 @@ static NOINLINE B match_cells(bool ne, B w, B x, ur wr, ur xr, usz len) { } B shape_c1(B, B); +B transp_c1(B, B); +B insert_c1(Md1D* d, B x); B cell_c1(Md1D* d, B x) { B f = d->f; if (isAtm(x) || RNK(x)==0) { B r = c1(f, x); @@ -355,7 +357,11 @@ B cell_c1(Md1D* d, B x) { B f = d->f; if (v(f)->type == t_md1D) { Md1D* fd = c(Md1D,f); u8 rtid = fd->m1->flags-1; - if (rtid == n_const) { f=fd->f; goto const_f; } + if (rtid==n_const) { f=fd->f; goto const_f; } + if ((rtid==n_fold || rtid==n_insert) && TI(x,elType)!=el_B && isPervasiveDy(fd->f) && RNK(x)==2 && SH(x)[1]==2) { + x = C1(transp, x); + return insert_c1(fd, x); + } } } } else if (!isMd(f)) {