#include typedef unsigned char uchar; typedef uchar * cp; typedef unsigned long long int li; typedef struct{struct envS * e; cp c;} fun; typedef unsigned int ui; typedef struct valS pf(ui); typedef struct valS{uchar tag; union{li i; fun f; pf * p;} u;} val; // tag=0 for i; tag=1 for f; tag=2 for prim fun. typedef struct envS {struct envS * out; val v;} env; static void prvx(val, int); static void pc(cp p, int m){cp j; printf("code @ %x:", (int)p); for(j = p; j0) {if(e) {prvx(e->v, lm-1); if(e->out) pe(e->out, lm-1);}} else printf("...");} printf("["); pe(e, m-1); printf("]\n");}}} int cc=0; void pev(cp p, env* e){pevx(p, e, 8); printf("--%d\n", cc++);} static void prvx(val v, int lm) {if(lm == 0) printf("val ...\n"); else {if(v.tag==0) printf("num = %lld\n", v.u.i); else if(v.tag==1) {printf("fun:"); pevx(v.u.f.c, v.u.f.e, lm-1);} else if(v.tag==2) printf("pfun: ??");}} void prv(val v){printf("v= "); prvx(v, 4); printf("--v\n");}