$title use and misuse of dynamic sets set i/1*1000/ j(i) k(i,i) l(i,i) /1*10 . 1*10/ m(i) /1*10, 20*30/; * define j to be a dynamic set - the first 300 elements of i j(i)$(ord(i) < 300) = yes; * k a dynamic set also - the cartesian product of i and j k(i,j) = yes; scalar n, val; * card() operation legal for both static and dynamic sets n = card(j); display n; n = card(k); display n; n = card(l); display n; * ord() operation valid only for static sets; by using it here we are * establishing m as a static set loop(m, val = ord(m); display val; ); * the following assignment requires m to be dynamic and is disallowed, * since it has already been established as a static set. m('40') = yes; * the following statement doesn't work, since ord() is not defined on a * dynamic set, and we have established j as dynamic above loop(j, val = ord(j); display val; );