Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Eiffel > Re: Precursor, ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 7 Topic 851 of 913
Post > Topic >>

Re: Precursor, symmetry of is_equal

by Gerald Hammer <hammer@[EMAIL PROTECTED] > Feb 23, 2007 at 10:32 AM

Daniel F Moisset schrieb:

[...]
> My problem will also happen in ETL3 if I get it correctly.
> 
> Just to clarify, let me post some code. It crashes at least in SE 2.x.
> If you have other compilers handy (I do not right now), I would like
> to know what the results are:
> 
> deferred class PARENT
> 
[...] -- Is OK
> 
> 
> class CHILD
> 
> inherit
>     PARENT redefine is_equal end

-- Add here the following
      PARENT
        rename is_equal as is_equal_parent
        select is_equal_parent
        end
> 
> create
>     make
> 
> feature
> 
>     make (a_a, a_b, a_c: STRING) is
>         require
>             a_a /= Void
>             a_b /= Void
>             a_c /= Void
>         do
>             a := a_a
>             b := a_b
>             c := a_c
>         end
> 
>     c: STRING
> 
>     is_equal (other: like Current): BOOLEAN is
>         do
-- Precursor is ambiguous at this point, so the following line has to be
-- replaced by
              Result := is_equal_parent (other)
--
-- >             Result := Precursor (other)
>             Result := Result and c.is_equal (other.c)
>         end
> 
> invariant
>     c /= Void
> 
> end
> 
> class MAIN
> 
[...] -- Is OK
> 
With this small change the example compiles end runs with EiffelStudio
5.7.
In fact »equality« as definded in PARENT and in CHILD are different
relations, and both are needed explicitly. So we must inherit two times
from PARENT, and »Precursor« is no more applicable. Do I misunderstand
anything?

Regards
-- 
Gerald Hammer




 7 Posts in Topic:
Precursor, symmetry of is_equal
"Daniel F Moisset&qu  2007-02-15 09:32:28 
Re: Precursor, symmetry of is_equal
Peter Horan <peter@[EM  2007-02-16 00:17:26 
Re: Precursor, symmetry of is_equal
Georg Bauhaus <bauhaus  2007-02-16 17:56:42 
Re: Precursor, symmetry of is_equal
Roger Browne <roger@[E  2007-02-16 17:19:06 
Re: Precursor, symmetry of is_equal
"Daniel F Moisset&qu  2007-02-16 12:59:17 
Re: Precursor, symmetry of is_equal
Gerald Hammer <hammer@  2007-02-17 10:54:41 
Re: Precursor, symmetry of is_equal
Gerald Hammer <hammer@  2007-02-23 10:32:31 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 0:49:15 CDT 2008.