added the equality(=) method to Array.

fixed the equality primitive handler to accept the subclasses of Semaphore/SemaphoreGroup
This commit is contained in:
hyunghwan.chung
2017-10-02 01:22:49 +00:00
parent c412097f6f
commit a54c2e21f2
6 changed files with 112 additions and 60 deletions

View File

@ -76,6 +76,29 @@ class(#pointer) Array(Collection)
{
0 priorTo: (anArray basicSize) do: [:i | self at: i put: (anArray at: i) ].
}
method = anArray
{
| size i |
if (self class ~~ anArray class) { ^false }.
size := self size.
if (size ~~ anArray size) { ^false }.
i := 0.
while (i < size)
{
if ((self at: i) ~= (anArray at: i)) { ^false }.
i := i + 1.
}.
^true.
}
method ~= anArray
{
^(self = anArray) not
}
}
## -------------------------------------------------------------------------------