Re: Single element of set



Date view Thread view Subject view Author view

Leonor Barroca (l.barroca@open.ac.uk)
Fri, 14 Apr 2000 09:54:10 +0100


This goes back to the discussion I started here some time ago (elements vs sets)...I also feel unhappy for not having a way of doing this in an easier way. I encounter this problem over and over again; for example, specifying functions on accounts that take as an argument the identifier of the account...it became so messy that I decided to specify the functions as taking the whole account as an argument; I think it is a liberty I can take but only during high level specification. Leonor At 07:31 PM 4/13/00 +0100, John Daniels wrote: >Dear list, > >I keep finding myself writing OCL like this: > >---------------- >Let h = hotel->select(x | "some test on x" )->asSequence->first in >---------------- > >where I have already asserted that the hotel set includes a single >element that matches the select condition. > >Is there a simpler way to access the single element of a set? > >Thanks, >--John > >========================================================================= >John Daniels >Tel/fax: +44 (0)20 8777 6007 > > > >To remove yourself from this list please mail puml-list-request@cs.york.ac.uk >with a message containing the word "unsubscribe". > Leonor Barroca Dept.of Computing The Open University Milton Keynes MK7 6AA l.barroca@open.ac.uk http://mcs.open.ac.uk/lmb3 tel: 01908 654864 sec:01908 653037


Date view Thread view Subject view Author view