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. 


On Tue, Aug 20, 2013 at 5:19 PM, Ruurd Idenburg <ruurd@idenburg.net> wrote:
This is the description of set~intersection: intersection
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
    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
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!
Oorexx-users mailing list