liberty-eiffel
[Top][All Lists]
Advanced

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

Re: Liberty-eiffel Digest, Vol 53, Issue 9


From: Paolo Redaelli
Subject: Re: Liberty-eiffel Digest, Vol 53, Issue 9
Date: Mon, 21 Feb 2022 00:22:16 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1

Il 21/02/22 00:10, Eric Bezault ha scritto:
On 20/02/2022 23:39, Paolo Redaelli wrote:
Wise words. I always wondered if "inherit {NONE}" is non conforming inheritance, what's the meaning of "inherit {ANY}" or inherit "{SOME_OTHER_CLASS}" ?

* inherit {NONE}: inheritance link (i.e. conformance) visible
  by no class. No client knows that the current class inherits
  from its parent, and therefore we cannot use this property
  when trying to figure out whether the type of the source of an
  assignment appearing in the client class conforms to the type
  of the target.

* inherit {ANY}: inheritance link visible by all classes.

* inherit {SOME_OTHER_CLASS}: inheritance link visible only
  by descendants of class SOME_OTHER_CLASS.


It's not very different from the notions 'feature {FOO}' or
'create {FOO}' where the feature or creation procedure is visible
only to descendants of class FOO, or to no class if FOO is NONE,
or to all classes if FOO is ANY.

That's interesting yet, but I can't find an use case....

For example...

class FOO feature salute do ... end

class HEIR inherit {FRIEND} FOO

class TRAITOR inherit {FOE} FOO

and somewhere else

class PERSON

feature manage(a_foo: FOO) a_foo.salute end

feature handle

    local h: HEIR; t: TRAITOR

    do

        manage(h)

        manage(t)

    end


class FRIEND inherit PERSON

class FOE inherit PERSON

What about calls like a_friend.handle and a_foe.handle? Are those correct?

Doesn't it allow for another form of catcall?




reply via email to

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