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
whoseindexes 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