liberty-eiffel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Liberty-eiffel] Set initial values on deferred classes


From: A. Arias
Subject: Re: [Liberty-eiffel] Set initial values on deferred classes
Date: Sun, 19 Jun 2016 23:58:44 -0600

Thanks for the example.

Germán

El dom, 19-06-2016 a las 11:59 +0200, Paolo Redaelli escribió:
> I'm in low-bandwidth mode... I wrote this little example while riding
> the train yestarday:
> Compile TED (Test Eiffel Deferred).
> The invariant is defined in the deferred DEF, the effective class is EFF.
> I'll refine it a little to add min and max as it may turn useful for
> incoming Gtk3 wrappers (I'm working on leggow for it)
> 
> 
> 2016-06-18 21:05 GMT+02:00, Germán A. Arias <address@hidden>:
> > For example I have a deferred class to handle the min size and max size
> > of the widgets. Then I want invariants like (or maybe postconditions as
> > you suggests):
> >
> > invariant
> >      min_width < max_width
> >      min_height < max_height
> >
> > So I need initial values, for example min_width = 0 and max_width = 100.
> > Of course I can do this at the class that inherits from this deferred
> > class. But is possible do this at the deferred class?
> >
> > Germán
> >
> > El sáb, 18-06-2016 a las 19:15 +0200, Paolo Redaelli escribió:
> >> Initialization is a task of creation procedures.
> >> Invariants are checked at the end of each feature call.
> >>
> >> You may want to your checks them as a postcondition,
> >>
> >> Il 18 giugno 2016 06:37:56 CEST, "Germán A. Arias"
> >> <address@hidden> ha scritto:
> >>         How can I set initial values for some features in deferred
> >> classes? For
> >>         example Objective-C have the method -init (and all its variants)
> >> that is
> >>         called each time an instance is created. Is there something
> >> similar in
> >>         Eiffel? My intention is add some invariants for some features in
> >>         deferred classes, but for this I need set some initial values.
> >> Any
> >>         advice about how is this achieved in Eiffel?
> >>
> >>         Thanks
> >>         Germán
> >>
> >>
> >>
> >>
> >> -- Inviato dal mio cellulare Android con K-9 Mail.
> >
> >
> >





reply via email to

[Prev in Thread] Current Thread [Next in Thread]