Support of algebraic operations on sets
Gary Chambers
gazzaguru2 at btinternet.com
Fri Jun 15 13:58:06 UTC 2007
I would expect difference, in this case, to have the common element taken
from "a" rather then "b", seeing as #difference: is non-commutative.
-----Original Message-----
From: squeak-dev-bounces at lists.squeakfoundation.org
[mailto:squeak-dev-bounces at lists.squeakfoundation.org] On Behalf Of Bert
Freudenberg
Sent: 15 June 2007 2:51 pm
To: The general-purpose Squeak developers list
Subject: Re: Support of algebraic operations on sets
On Jun 15, 2007, at 14:45 , sig wrote:
> actually i missing these operations for dictionaries.
> in current implementation if you diff/union on two dictionaries,
> you'll find out that associations play role as set elements, not keys.
>
> for dictionaries 'a difference: b' i get not exactly what i would
> expect.
Dictionaries are like other collections - a collection of
"elements" (the values). The keys are only interesting for accessing
- like indices on Arrays. #do: operates on the values. So does
#select:, and #difference:. You wouldn't expect #difference: on an
Array to work on its indices, would you?
- Bert -
More information about the Squeak-dev
mailing list
|