smalltalk
/
osmo-st-all
Archived
1
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
osmo-st-all/grease/Core/Text/GRMappedPrinter.st

37 lines
644 B
Smalltalk

GRPrinter subclass: GRMappedPrinter [
| next block |
<comment: nil>
<category: 'Grease-Core-Text'>
GRMappedPrinter class >> block: aBlock next: aPrinter [
<category: 'instance creation'>
^(self new)
block: aBlock;
next: aPrinter;
yourself
]
block: aBlock [
<category: 'accessing'>
block := aBlock
]
next: aPrinter [
<category: 'accessing'>
next := aPrinter
]
initialize [
<category: 'initialization'>
super initialize.
self block: [:value | value]
]
print: anObject on: aStream [
<category: 'printing'>
next print: (block value: anObject) on: aStream
]
]