I wanted to use non-const variables, so how exactly how I can get this to work?
foo:
eval "
const s=4;
const n=10;
m=expr('v(100)',prod(s,n));
print(m);
driver(a,b,c,nb_elts)=(
ref(m[a,b],temp);
temp=sort(temp,1,nb_elts,s,c);
print(temp);
unref(temp);
);
section_sort(a,b,c)=(
driver(a*s,(b-a)*s,c,b-a);
);
v0=3;v1=6;
section_sort(v0,v1,0);
v0=4;v1=9;
section_sort(a,b,1);
"
The idea is to sort a section of a vector. I think the copy adjusting memory thing could be key to this. I know you can touch const with that.
Here is what I did:
foo:
eval "
const v0=0;
const v1=0;
for(p=0,p<2,++p,
copy(addr(v0),p);
copy(addr(v1),p+1);
print(v0);
print(v1);
);
print(isconst(v0));
print(isconst(v1));
"
This proves you can touch const with copy(). But, I did noticed G’MIC only knows the initial declaration is a const.