564 'Cons [error]: printOn: of self referencing collection.' errorPrintCR. |
564 'Cons [error]: printOn: of self referencing collection.' errorPrintCR. |
565 aStream nextPutAll:'#("recursive")'. |
565 aStream nextPutAll:'#("recursive")'. |
566 ^ self. |
566 ^ self. |
567 ]. |
567 ]. |
568 |
568 |
569 (car isLazyValue not and:[ car isCons ]) ifTrue:[ |
569 aStream nextPutAll:'('. |
570 aStream nextPutAll:'('. |
570 self printRestOn:aStream. |
571 car printOn:aStream. |
571 |
|
572 "Modified: / 18-05-2010 / 10:25:49 / cg" |
|
573 "Modified: / 02-04-2019 / 23:59:15 / Claus Gittinger" |
|
574 ! |
|
575 |
|
576 printRestOn:aStream |
|
577 thisContext isRecursive ifTrue:[ |
|
578 'Cons [error]: printOn: of self referencing collection.' errorPrintCR. |
|
579 aStream nextPutAll:'#("recursive")'. |
|
580 ^ self. |
|
581 ]. |
|
582 |
|
583 car printOn:aStream. |
|
584 cdr isNil ifTrue:[ |
572 aStream nextPutAll:')'. |
585 aStream nextPutAll:')'. |
573 ] ifFalse:[ |
586 ^ self. |
574 car printOn:aStream. |
587 ]. |
575 ]. |
|
576 |
|
577 aStream nextPutAll:'!!'. |
|
578 |
|
579 (cdr isLazyValue not and:[ cdr isCons ]) ifTrue:[ |
588 (cdr isLazyValue not and:[ cdr isCons ]) ifTrue:[ |
580 aStream nextPutAll:'('. |
589 aStream nextPutAll:' '. |
581 cdr printOn:aStream. |
590 cdr printRestOn:aStream. |
582 aStream nextPutAll:')'. |
591 ^ self. |
583 ] ifFalse:[ |
592 ]. |
584 cdr printOn:aStream. |
593 |
585 ]. |
594 aStream nextPutAll:' . '. |
586 |
595 cdr printOn:aStream. |
587 "Modified: / 18-05-2010 / 10:25:49 / cg" |
596 aStream nextPutAll:')'. |
|
597 |
|
598 "Created: / 02-04-2019 / 23:55:05 / Claus Gittinger" |
588 ! ! |
599 ! ! |
589 |
600 |
590 !Cons methodsFor:'queries'! |
601 !Cons methodsFor:'queries'! |
591 |
602 |
592 beginAndSizeOfCycle |
603 beginAndSizeOfCycle |