Menu

#206 SOIL does not accept implicit iterators?

None
assigned
None
high
major
Always
SOIL
5.2
Windows
2020-05-03
2020-05-02
No

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.

Discussion

  • QUASAR research group

    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

     
  • Andreas Kaestner

    • status: new --> assigned
    • assigned_to: Andreas Kaestner
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.