class Customer
operations
-- with standard OCL (implicit iterator compiles OK)
validCards1(): Set(CustomerCard) = self.cards->select(valid)
-- with SOIL (explicit iterator variable compiles OK)
validCards2(): Set(CustomerCard)
begin
result:= self.cards->select(c | c.valid)
end
-- with SOIL (implicit iterator variable does not compile ...)
validCards3(): Set(CustomerCard)
begin
result:= self.cards->select(valid)
end
-- Could not compile soil defined operation validCards3() : Set(CustomerCard)' due to the following error:
-- RoyalAndLoyal.use:154:4: Variablevalid' in expression `self.cards->select(valid)' is undefined.
This is another "minor" issue that has a "big" impact on teaching OCL with SOIL, since it is difficult to explain somophors why selectors in pure OCL do not require explicit iterators, but equivalent SOIL versions do.
Thank you in advance for your attention!
Fernando Brito e Abreu