1(kill(all), load("charsets_flatten.lisp"), 0); 20$ 3 4charsets_flatten(3); 53$ 6 7charsets_flatten(-3); 8-3$ 9 10charsets_flatten(2/3); 112/3$ 12 13charsets_flatten(-2/3); 14-2/3$ 15 16charsets_flatten(1.4d2); 171.4d2$ 18 19charsets_flatten(-3.4d0); 20-3.4d0$ 21 22charsets_flatten(x); 23x$ 24 25charsets_flatten(abc); 26abc$ 27 28charsets_flatten(%pi); 29%pi$ 30 31charsets_flatten(rat(x)); 32x$ 33 34charsets_flatten(x[5]); 35x[5]$ 36 37charsets_flatten(x[8,32]); 38x[8,32]$ 39 40charsets_flatten(-x); 41-x$ 42 43charsets_flatten(rat(-x)); 44-x$ 45 46charsets_flatten(a+b); 47a+b$ 48 49charsets_flatten(rat(a+b)); 50a+b$ 51 52charsets_flatten(a*b); 53a*b$ 54 55charsets_flatten(a/b); 56a/b$ 57 58charsets_flatten(a*b*c); 59a*b*c$ 60 61charsets_flatten(a^b); 62a^b$ 63 64charsets_flatten(a^(a^b)); 65a^(a^b)$ 66 67charsets_flatten([]); 68[]$ 69 70charsets_flatten([[]]); 71[]$ 72 73charsets_flatten([x]); 74[x]$ 75 76charsets_flatten([[x]]); 77[x]$ 78 79charsets_flatten(f(g(f(f(x))))); 80f(g(f(f(x))))$ 81 82charsets_flatten(f(f(g(f(x))))); 83f(g(f(x)))$ 84 85/* Examples from Macsyma 422 */ 86 87charsets_flatten([a,b,[c,[d]],e,[[f],g,h]]); 88[a,b,c,d,e,f,g,h]$ 89 90charsets_flatten([a,b([c]),[d]]); 91[a,b([c]),d]$ 92 93charsets_flatten(f(f(a,b), f(c,d))); 94f(a,b,c,d)$ 95 96charsets_flatten(f[1](f[1](a,b), f[1](c,d))); 97f[1](a,b,c,d)$ 98 99 100/* every tests */ 101charsets_every([]); 102false$ 103charsets_every([false]); 104false$ 105charsets_every([false,false]); 106false$ 107charsets_every(false); 108false$ 109charsets_every(false,false); 110false$ 111charsets_every(true); 112true$ 113charsets_every([true]); 114true$ 115charsets_every([true,true]); 116true$ 117charsets_every(true,true); 118true$ 119charsets_every([true,false]); 120false$ 121charsets_every(true,false); 122false$ 123