Ok, I see I'm referring to the receiver as a MapCollection, which a set ain't and for Set the items in the argument collection are used.

Gotta subclass .set  then to get what I want.

Ruurd

On 21-8-2013 1:00, Ruurd Idenburg wrote:
Thanks Rick, but from .directory upwards the inheritance chain isn't it:

.directory -> .MapCollection -> .Collection

So what about this in section 5.3.19:

If argument is a MapCollection, then index values are used to determine membership, and items are
inserted into the result using the index and item pairs.

Ruurd

On 21-8-2013 0:46, Rick McGuire wrote:
What you are missing is the act of coercing the source collection into a compatible type (this is described in section 5.3.19 The Concept of Set Operations).  In this situation, the items are used to integration with the set.  If you wish to merge the indexes, then source~allindexes as an argument for the merge. 

Rick


On Tue, Aug 20, 2013 at 5:19 PM, Ruurd Idenburg <ruurd@idenburg.net> wrote:
This is the description of set~intersection:

5.3.14.4. intersection
>>-intersection(argument)--------------------------------------><
Returns a new collection (of the same class as the receiver) containing only those items from the receiver
whose indexes are in both the receiver collection and the argument collection. The argument can be any
collection class object. The argument must also allow all of the index values in the receiver collection.

and I think this is the code for set~intersection in CoreClasses.orx:

::METHOD intersection                  -- take the intersection of sets
use strict arg other                   -- get the companion object
signal on nomethod
new = self~class~new                   -- use a new instance
if other~isA(.Collection) then
    values = other~allitems            -- get all of the items from the other collection
else
    values = other~makearray           -- ask for an array version of the source
count = values~items
do i = 1 to count
    index = values[i]
    -- if we have one of these, put into the result
    -- NB:  Since this is a SET, there will only be one copy accumulated.
    if self~hasindex(index) then
         new~put(index)
end
return new                             -- return the difference collection
nomethod:                              -- unknown method sent
  raise syntax 93.948 array(1, "Collection")

In my case the other collection is a .directory, where items and indexes are not necessarily the same.

What am I misunderstanding?

-- Ruurd Idenburg

------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users




------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk


_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users


-- 
Ruurd Idenburg


------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk


_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users


-- 
Ruurd Idenburg