Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Smalltalk Programming/Overview

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

removeEventsTriggeredFor: anObject inState: aState "Remove all the events triggered by the receiver which would have been sent to anObject in the given state." | events | events := transitions at: aState ifAbsent: [ ^self ]. events copy keysAndValuesDo: [:evtSym :msgSendSet | | newSet | newSet := msgSendSet reject: [:each | each receiver == anObject and: [ (anObject == self and: [ each selector == #newState: ]) not ] ]. msgSendSet size = newSet size ifFalse: [newSet isEmpty ifTrue: [ events removeKey: evtSym] ifFalse: [ events at: evtSym put: newSet]]]. Claim: Lots of indentions is a sign that code needs to be refactored. CPS