ECL matches operation for Sets [message #1269886] |
Wed, 12 March 2014 05:34  |
Eclipse User |
|
|
|
Hello,
From the Epsilon book (Section 8.3.4) I understood that in case I call in ECL the matches operation on a Set with a Set as parameter, it is determined if for each item in the source collection (context) a matching item in the target collection (parameter) exists. However, the org.eclipse.epsilon.ecl.execute.operations.MatchesOperation class does not distinguishes between collection types and applies the same behavior for Sets as for OrderedSets and Sequences (the two collections have to have the same amount of items and items of the same index have to match).
I expected the following behavior (expressed in EOL):
operation Set matches(targetSet : Set) : Boolean {
for (source : Any in self) {
var sourceTargetMatchFound : Boolean = false;
for (target : Any in targetSet) {
if (source.matches(target))
sourceTargetMatchFound = true;
}
if (not sourceTargetMatchFound) {
return false;
}
}
return true;
}
Do you intend to adapt the behavior for Sets / Bags?
Best,
Tanja
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03950 seconds