Hi all,
In the definitions of MappedCollection>>reject: and MappedCollection>>select:
include the following code:
| newMap |
newMap := newMap select: [:key | aBlock value: (self at: key)].
The uninitialized temporary variable `newMap' has the value `nil', which
obviously cannot understand message `select:'. According to the semantic
of MappedCollection>>reject: or MappedCollection>>select:, the third
occurrence of `newMap' in the above code should be `map', so this `newMap'
may be a variable name typo. The attached patch could fix those variable
name typos.
lee
ChangeLog
2013-12-11 Lee Duhem <[email protected]>
* kernel/MappedColl.st: Fixs variable name typos in reject: and select:.
diff --git a/kernel/MappedColl.st b/kernel/MappedColl.st
index e22f8f6..b0d3c55 100644
--- a/kernel/MappedColl.st
+++ b/kernel/MappedColl.st
@@ -187,7 +187,7 @@ map would be an Interval.
<category: 'basic'>
| newMap |
- newMap := newMap reject: [:key | aBlock value: (self at: key)].
+ newMap := map reject: [:key | aBlock value: (self at: key)].
^self class collection: domain map: newMap
]
@@ -196,7 +196,7 @@ map would be an Interval.
<category: 'basic'>
| newMap |
- newMap := newMap select: [:key | aBlock value: (self at: key)].
+ newMap := map select: [:key | aBlock value: (self at: key)].
^self class collection: domain map: newMap
]
_______________________________________________
help-smalltalk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-smalltalk