RosettaCodeData/Task/Singleton/Oforth/singleton-1.oforth
2016-12-05 23:44:36 +01:00

6 lines
224 B
Text

Object Class new: Sequence(channel)
Sequence method: initialize(initialValue)
Channel newSize(1) := channel
@channel send(initialValue) drop ;
Sequence method: nextValue @channel receive dup 1 + @channel send drop ;