Why am I having outdated command, yet it's not in user.gmic or update405.gmic?

I echoed these two commands, and the first one is not in disk.

C:\Windows\System32>gmic e $$rep_rde_compsel_comb
[gmic]./ Start G'MIC interpreter (v.4.0.5).
skip ${3=x} k,t:=sort([${1-2}]) check isint($k,2) N={perm($k-1,$t-1,0)} if !isint(_'$3',_'x',_'y') u $N return fi if $k==$t 1,1,1,$k,c return fi axis={_'$3'-_'x'} {v=vector(#3,1);v[$axis]=$N;v},$1 +rep_mt_f32v_map {$N>>[0,12]},0 eval. :"begin( const t=$t; const k=$k; const dk=k-1; const dt=t-1; const N=whd#-2; gosper_hack()=( g0=cn&-cn; g1=cn+g0; cn=int((xor(cn,g1)>>2)/g0)|g1; ); step()=( ik=dk;n=cn; p=t; while(n, r[--p]=n&1?(ik--):ik; n>>=1; ); gosper_hack(); I[#-2,x]=r; ); ); j=J(-1); x=j[0]<<24|j[1]; i=i0<<24|i1; r=vector(#t); x?( index=N-1-x; p=ix=0; ik=dk; while(++p<t, if(ik, block=perm(ik-1,dt-p,0); index<block?( ++ix; --ik; ):( index-=block; ); ); r[p]=ix; ); p=cn=0; while(++p<t,if(r[p]>r[p-1],cn|=1<<(dt-p););); gosper_hack(); I[#-2,x]=r; ):( cn=(1<<dk)-1; step(); ); while(++x<i,step();); _0; " rm.
[gmic]./ End G'MIC interpreter.

C:\Windows\System32>gmic e $$+rep_rde_compsel_comb
[gmic]./ Start G'MIC interpreter (v.4.0.5).
skip ${3=x}  k,t:=sort([${1-2}])  check isint($k,2)  N={perm($k-1,$t-1,0)}  if !isint(_'$3',_'x',_'y')  u $N  return  fi  if $k==$t  1,1,1,$k,c  return  fi  axis={_'$3'-_'x'}  {v=vector(#3,1);v[$axis]=$N;v},$1  +rep_mt_f32v_map {$N>>[0,12]},0  eval. :"begin(  const t=$t;  const k=$k;  const dt=t-1;  const K=k>2;  r=vector(#t);  K?(  const dk=k-1;  const lp=dk-1;  const N=$N;  pos=vector(#dk);  orig_r=expr('x',lp)+2;  orig_pos=expr('x',dk)+t-k+1;  );  );  O=J(-1);  P=O[0]<<24|O[1];  Q=i0<<24|i1;  K?(  P?(  idx=N-1-P;  p=q=id=0;  ik=dk;  while(++p<t,  if(ik,  block=perm(ik-1,dt-p,0);  idx<block?(  ++id;  --ik;  pos[q++]=p;  ):(  idx-=block;  );  );  r[p]=id;  );  ):(  pos=orig_pos;  repeat(dk,p,  r[pos[p]]=p+1;  );  ind=lp;  );  I[#-2,P]=r;  while(++P<Q,  m=lp;  while(m&&pos[m]-pos[m-1]==1,--m;);  M=m+1;  --pos[m];  m==lp?(  r[pos[m]]=M;  ):(  copy(r[pos[m]],[M],orig_pos[M]-pos[m],1,0);  );  m<lp?(  rem=lp-m;  copy(pos[M],orig_pos[M],rem);  copy(r[orig_pos[M]],orig_r[m],rem);  );  I[#-2,P]=r;  );  ):(  copy(r[dt-P],[1],P+1,1,0);  p=dt-P;  I[#-2,P]=r;  while(++P<Q,  r[--p]=1;  I[#-2,P]=r;  );  );  _0;  "  rm.
[gmic]./ End G'MIC interpreter.

The + one is newer. What happened?

EDIT: I just deleted it and I’m still getting the old command code even though it’s not there in update405.gmic. And none exist in user.gmic. The old one use gosper hack trick.

Are you somehow loading the old one? Common mistake of mine when I am doing bazillion things at once. Other times, I just reboot or restart the console.

I don’t know, it should not be there.

  • If your old command was defined before the release of latest G’MIC release, then the gmic binary has a copy of it directly in its binary executable. Each new released binary embeds the full content of the stdlib + community updates.

  • Then, if you had an old command defined as my_command : (some code), then decided to “redefine” it with +my_command: (some different code), then the initial version of my_command is not replaced by +my_command, because that’s actually two different command definitions that trigger commands in different contexts (whether the command is called with a + prefix or not). So if you call my_command in your script somewhere, that’s the first version that is still used (unless you call it explictely with +my_command of course).

That may explain your issue ?

Yes, that makes sense, so basically all I need to do is wait for 4.06. Alright.

You can also decide to redefine your old command (without the +), so that the old one become superseeded

my_command : +my_command $"*"
1 Like