[Pharo-dev] Announcer problem :)

Stéphane Ducasse stephane.ducasse at inria.fr
Sun Aug 4 11:42:30 EDT 2013


The real problem is that the error that was raised on on:do: was removed and now...

NewValueHolder>>whenChangedDo: aBlock

	| block |
	block := [:announcement :ann | aBlock cull: announcement newContents cull: announcement oldContents cull: announcement cull: ann ].
	announcer weak on: ValueChanged do: block

Now may be it is not a problem and a strong reference is ok too. 
We will have to analyse that.

Stef



> So igor is thinking about ephemerons and object formats.
> Because we are going over all the weak on:do: and rewriting the ones we can.
> 
> 
> whenListChanged: aBlock
> 	"Specify a block to value after the contents of the list has changed"
> 
> 	"Basically when you set a new list of items"
> 
> 	<api: #event>
> 	| block |
> 	block := [ :announcement :ann | 
> 	aBlock
> 		cull: announcement newContents
> 		cull: announcement oldContents
> 		cull: announcement
> 		cull: ann ].
> 	listAnnouncer weak
> 		on: ValueChanged
> 		do: block
> 
> 
> On Aug 4, 2013, at 4:16 PM, Stéphane Ducasse <Stephane.Ducasse at inria.fr> wrote:
> 
>> addDependent: anObject
>> 
>> 	self announcer 
>> 		on: MorphChanged
>> 		do: [ :ann | anObject update: ann selector ].
>> 		
>> 	self announcer 
>> 		on: MorphChangedWithArguments
>> 		do: [ :ann | anObject update: ann selector with: ann arguments ].
>> 			
>> 	^ anObject
>> 
>> is an example of the problem because addDependent: was holding also weakly its dependent and now
>> we cannot use weak with blocks.
>> 
>> Stef
> 
> 





More information about the Pharo-dev mailing list