« Return to Thread: Help sought for formal specification

Re: Re: Help sought for formal specification

by Peter Gummer-2 :: Rate this Message:

Reply to Author | View in Thread

ct2049 wrote:

> I noticed that MML_SET  has a feature called "for_fall" that takes a
> predicate.  I think this may be what I want. However, it takes a
> "PREDICATE" as a parameter and I'm having a lot of trouble
> understanding how the PREDICATE class works and what I need to do to
> set it up.
>
> If I had some code that looks like this:
> test : MML_SET[REAL]
> and I'd like to make sure that every element in test is less than 100
> how would I do this?

A PREDICATE is instantiated as an agent for a BOOLEAN function. So you would
write a function like this:

>    is_less_than_100 (x: REAL): BOOLEAN
>            -- Is `x' < 100?
>        do
>            Result := x < 100
>        end

I am not familiar with MML_SET, but I assume you would do something like
this:

>    test.for_fall (agent is_less_than_100)

- Peter Gummer



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/eiffel_software/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/eiffel_software/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:eiffel_software-digest@...
    mailto:eiffel_software-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    eiffel_software-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

 « Return to Thread: Help sought for formal specification

LightInTheBox - Buy quality products at wholesale price