Let's look at the chunk example.
exportTraitDefinitionOf: aClass on: aStream
�� "Chunk format."
�� aStream
������ nextPutAll: 'Trait named: '; nextPutAll: aClass name; cr;
������ tab; nextPutAll: 'package: '; print: aClass category; nextPutAll: '!!'; cr.
�� aClass comment isEmpty ifFalse: [
������ aStream
���������� nextPutAll: '!!'; print: aClass; nextPutAll: 'commentStamp!!'; cr;
���������� nextPutAll: aClass category withDelimiter: $!; nextPutAll: '!!'; cr].
�� aStream cr.
With the exception of #nextPutAll:withDelimiter:, this is completely
standard and portable.�� If I am willing to do something nonstandard,
�� aStream format: 'Trait named: {s}{n}{t}package: {p}{n}'
������ with: aClass name with: aClass category.
�� aClass comment isEmpty ifFalse: [
������ aStream format: '!!{p} commentStamp!!{n}{D$!}!!{n}'
���������� with: aClass with: aClass comment].
�� aClass format: '{n}.
#write: really does not seem to be any improvement over #nextPutAll:.
For what it's worth, GNU Smalltalk also has #<<, which it defines
to be equivalent to #displayOn:, if memory serves me correctly.
It has never been clear to me what the use case for #write: is.
In Pharo 7, for streams it is the same as #putOn: except for the
result.�� Neither of them is in any interesting way "higher
level" than #nextPut: or #nextPutAll:, merely less informative.