static obj_ptr _cdr(obj_ptr arg, obj_ptr env) { if (NCONSP(arg)) return MKERROR(MKSTRING("Expected a pair in cdr"), arg); return CDR(arg); }
int prn_func_macr(Obj a, Obj stream, char* which){ Obj env = CADR(a); Obj args = CADDR(a); Obj body = CDDDR(a); writestr(stream, "("); writestr(stream, which); writestr(stream, " "); prnobj( args, stream, 1); writestr(stream, " "); a = body; while( NNULLP( a )){ if( NCONSP( a )){ writestr(stream, " . "); prnobj(a, stream, 1); break; } writestr(stream, " "); prnobj( CAR(a), stream, 1); a = CDR( a ); } writestr(stream, ")"); return 1; }
int prncons(Obj a, Obj stream, int how){ writestr(stream, "("); prnobj(CAR(a), stream, how); a = CDR(a); while( NNULLP( a )){ if( NCONSP( a )){ writestr(stream, " . "); prnobj(a, stream, how); break; } writestr(stream, " "); prnobj( CAR(a), stream, how ); a = CDR( a ); } writestr(stream, ")"); return 1; }