@@ -331,18 +331,24 @@ register pointer p;
331331 pointer_update (p -> c .obj .iv [0 ],makeint (++ ix ));
332332 } }
333333
334- static int getprlength (ctx )
334+ static int getprlength (ctx , isnull )
335335context * ctx ;
336+ int * isnull ;
336337{ register pointer x ;
337338 x = Spevalof (PRLENGTH );
338- if (isint (x )) return (intval (x ));
339- else return (65536 );}
339+ if (isint (x )) {
340+ * isnull = 0 ;
341+ return (intval (x ));}
342+ else {
343+ * isnull = 1 ;
344+ return (0 );} }
340345
341346static pointer printvector (ctx ,vec ,f ,leng ,prlevel )
342347register context * ctx ;
343348register pointer vec ,f ,leng ;
344349int prlevel ;
345- { register eusinteger_t n ,i = 0 ,eltype ,x ,prlength = getprlength (ctx );
350+ { register eusinteger_t n ,i = 0 ,eltype ,x ;
351+ int nullprlen = 0 , prlength = getprlength (ctx , & nullprlen );
346352 pointer sizesave ;
347353
348354 eltype = elmtypeof (vec );
@@ -366,7 +372,7 @@ int prlevel;
366372 printstr (ctx ,n ,vec -> c .str .chars ,f ); break ;
367373 case ELM_INT :
368374 writestr (f ,(byte * )"#i(" ,3 );
369- while (i < n && prlength > 0 ) {
375+ while (i < n && ( nullprlen || prlength > 0 ) ) {
370376 printint (ctx ,vec -> c .ivec .iv [i ++ ],f ,intval (Spevalof (PRINTBASE )),
371377 0 ,0 );
372378 if (i < n ) writech (f ,' ' );
@@ -376,7 +382,7 @@ int prlevel;
376382 break ;
377383 case ELM_FLOAT :
378384 writestr (f ,(byte * )"#f(" ,3 );
379- while (i < n && prlength > 0 ) {
385+ while (i < n && ( nullprlen || prlength > 0 ) ) {
380386 printflt (vec -> c .fvec .fv [i ++ ],f );
381387 if (i < n ) writech (f ,' ' );
382388 prlength -- ; }
@@ -395,7 +401,7 @@ int prlevel;
395401 writech (f ,' ' );
396402 printint (ctx ,(eusinteger_t )vec -> c .vec .size ,f ,intval (Spevalof (PRINTBASE )),0 ,0 );
397403 writech (f ,' ' );}
398- while (i < n && prlength > 0 ) {
404+ while (i < n && ( nullprlen || prlength > 0 ) ) {
399405 prin1 (ctx ,vec -> c .vec .v [i ++ ],f ,prlevel );
400406 if (i < n ) writech (f ,' ' ); }
401407 if (i < n ) writestr (f ,(byte * )"... " ,4 );
@@ -476,7 +482,8 @@ register pointer x,f;
476482register pointer fobj ;
477483register int prlevel ;
478484{ register pointer rest = ccdr (x );
479- register int prlength = getprlength (ctx ),shareix ;
485+ register int shareix ;
486+ int nullprlen = 0 , prlength = getprlength (ctx , & nullprlen );
480487
481488 if (fobj == QUOTE && islist (rest ) && ccdr (rest )== NIL ) {
482489 writech (f ,'\'' );
@@ -490,7 +497,7 @@ register int prlevel;
490497 prin1 (ctx ,fobj ,f ,prlevel );
491498 x = rest ;
492499 while (islist (x ) && !s_marked (x )) {
493- if (-- prlength <=0 ) {
500+ if (! nullprlen && -- prlength <=0 ) {
494501 writestr (f ,(byte * )" ..." ,4 );
495502 x = NIL ; break ;}
496503 else {
@@ -507,14 +514,14 @@ register pointer fobj;
507514int prlevel ;
508515{ pointer klass , * varvec ;
509516 register int i = 0 ,s ;
510- int prlength = getprlength (ctx );
517+ int nullprlen = 0 , prlength = getprlength (ctx , & nullprlen );
511518
512519 writestr (f ,(byte * )"#s(" ,3 );
513520 klass = classof (x );
514521 printsym (ctx ,klass -> c .cls .name ,f );
515522 s = objsize (x ); varvec = klass -> c .cls .vars -> c .vec .v ;
516523 prlength -- ;
517- while (i < s && prlength > 0 ) {
524+ while (i < s && ( nullprlen || prlength > 0 ) ) {
518525 writech (f ,' ' );
519526 printsym (ctx ,varvec [i ],f );
520527 writech (f ,' ' );
@@ -532,12 +539,13 @@ pointer fobj;
532539int prlevel ;
533540{ pointer klass ;
534541 register int i = 0 ,s ;
535- int prlength = getprlength (ctx );
542+ int nullprlen = 0 , prlength = getprlength (ctx , & nullprlen );
543+
536544 writestr (f ,(byte * )"#J(" ,3 );
537545 klass = classof (x );
538546 printsym (ctx ,klass -> c .cls .name ,f );
539547 s = objsize (x );
540- while (i < s && prlength -- > 0 ) {
548+ while (i < s && ( nullprlen || prlength -- > 0 ) ) {
541549 writech (f ,' ' );
542550 if (i == 0 ) prin1 (ctx ,fobj ,f ,prlevel );
543551 else prin1 (ctx ,x -> c .obj .iv [i ],f ,prlevel );
0 commit comments