[squeak-dev] The Inbox: Collections-ct.870.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Dec 30 14:01:29 UTC 2019


A new version of Collections was added to project The Inbox:
http://source.squeak.org/inbox/Collections-ct.870.mcz

==================== Summary ====================

Name: Collections-ct.870
Author: ct
Time: 30 December 2019, 3:01:24.515602 pm
UUID: cb75296c-0850-d440-97a6-fc1962eef672
Ancestors: Collections-nice.868

Proposal: Refine Dictionary >> #at:ifPresent: not to require an one-arg block.

Usage example:
	Smalltalk at: className ifPresent: [self inform: 'Class already exists'. ^ nil].

=============== Diff against Collections-nice.868 ===============

Item was changed:
  ----- Method: Dictionary>>at:ifPresent: (in category 'accessing') -----
  at: key ifPresent: aBlock
  	"Lookup the given key in the receiver. If it is present, answer the value of evaluating the given block with the value associated with the key. Otherwise, answer nil."
  
  	| v |
  	v := self at: key ifAbsent: [^ nil].
+ 	^ aBlock cull: v
- 	^ aBlock value: v
  !



More information about the Squeak-dev mailing list