class S
inherit F1
export {STRING} print_me
undefine print_me
end
inherit F2
export {INTEGER} print_me
undefine print_me
end
Is print useable from STRING or INTEGER or from both classes or should
this throw an error ?
According to ECMA 367-2, section 8.7.12, page 52, we take the union
of the clients. So it is exported to both STRING and INTEGER.
--
Eric Bezault
mailto:er...@gobosoft.com
http://www.gobosoft.com
This is my understanding as well.
One interesting aspect. Under conformant inheritance a feature can
only win clients, never loose (i.e. cumulation of clients). This has
the advantage, that certain catcalls where a descendent hides a
feature are no longer possible in ECMA Eiffel. Descendant hiding is no
longer allowed under conformant inheritance. Non conformant
inheritance allows descendant hiding, but disallows polymorphic
attach.
Regards
Helmut
> > According to ECMA 367-2, section 8.7.12, page 52, we take the union
> > of the clients. So it is exported to both STRING and INTEGER.
>
> > --
> > Eric Bezault
> > mailto:er...@gobosoft.comhttp://www.gobosoft.com
>
> This is my understanding as well.
I'm not sure if this is okay. Both export client lists are
written explicitly and in the same text file so there is no reason
why the compiler should not force the user to write complete correct
exports.
So throwing an error looks like a better solution for me. It looks
much like autocorrection of an error. And based on my experience with
SmartEiffel this is the worst thing they have ever added to Eiffel.
> One interesting aspect. Under conformant inheritance a feature can
> only win clients, never loose (i.e. cumulation of clients).
I'm not so sure about this rule. Does ECMA really define it?
For me the client visibility is totally independent from the
inheritance/conforming hierarchy.
According to pre ECMA Eiffel you are right. But ECMA changed the
semantics of the export clause under conformant inheritance. The basic
idea: With conformant inheritance exports are cumulative, i.e. in your
example above
> class S
> inherit F1
> export {STRING} print_me
> undefine print_me
> end
> inherit F2
> export {INTEGER} print_me
> undefine print_me
> end
the feature "print_me" has all the clients defined for "print_me" in
F1 plus all the clients from F2 plus {STRING,INTEGER}.
Therefore as I have said before, descendant hiding is no longer
possible with conformant inheritance. For non-conformant inheritance
the rules are different.
Wow, that will break a lot of code.
Looks like i have to print out Meyers new ETL book and study it.
The ECMA standard paper is a really dry read.
Unfortunately the ETL3 book draft has not been updated since August 2005,
as far as I can see on the ETHZ homepage, so you will have to read the
standard (although it is outdated in some chapters like void-safety).
Martin
This has always been the case in Eiffel, you take the union of exports.
What has changed in the ECMA Eiffel standard is that you cannot restrict
the export of an inherited routines, but that's for addressing the well
known A in CAT calls.
Regards,
Manu
If Eiffel had always taken the union of exports, it wouldn't be
possible to restrict the export of an inherited routine. Union means
all the clients of the parent *plus* the clients of the current class.
It is funny that you say that I am wrong and by the same token you say
the same what I have stated before.
Another remark: The standard is not only outdated with respect to void
safety. The chapters concerning covariant redefinition and catcalls
are obsolete as well. This seems to be the reason that it takes so
long to get an updated version.
Manu, you as a leading member of the ECMA committee might give us a
hint when to expect an updated version of the standard.
Regards
Helmut
> Manu, you as a leading member of the ECMA committee might give us a
> hint when to expect an updated version of the standard.
By the way, what are EiffelStudio users doing?
The website and help menu links to the very old OOSE book as the only
reference. Do you really expect that this is enough for users of a
5000$
tool?
Maybe you guys should really consider Guidos advice for Python.
Stop all language development for 5 years and fix the worst problems
first.
Most of what you discuss is so insane far away from users needs
its upsets me. You should really sit down and write 100 times:
"Programming languages features are not important" on your
commitee whiteboard.
And i see i agree more and more with the SmartEiffel teaam that
ECMA Eiffel is a failure and not Eiffel anymore and the death of
the language. The community is getting smaller and smaller, even
universities are moving away from teaching it in Software
engineering courses.
The ECMA standard is and was nothing more then a helpless
marketing idea. Remembers me of all the non finished standards
during the unix wars. But there it were different companies fighting.
Here the problems are homemade by crazy guys from one same company.
Take this rant as a hint from someone who was never wrong in the
past 8 years with any prediction of the future of eiffel and
public eiffel based projects.
The problem: It has not been updated since june 2006. I.e. it reflects
a status which has never been implemented (and will probably never be
implemented, not even by EiffelStudio).
The question was about inheritance and what you do on merging two sets
of export clauses. Answer you take the union and there is no need to
discuss that point, it has always been like that for at least the past
15 years.
Restricting exports is when you give a new export list, either via
inheritance, or via redefinition in a give feature clause which has an
export clause.
Regards,
Manu
Manu, we agree completely on the status as it is now. No need to
discuss that. But in the past it was different. Bertrands last book to
specify Eiffel (Eiffel - The Language, ETL2) stated that with
class OSTRICH inherit
BIRD export {NONE} fly end -- <---- "descendant hiding"
...
end
you replace the client list of "fly" inherited from BIRD with an empty
one. Union of client lists from the parent and the heir was not part
of ETL2 (maybe union of client lists of different inheritance
clauses). In ECMA Eiffel you cannot achieve that replacement of the
client list with conformant inheritance. You have to write instead
class OSTRICH inherit {NONE}
BIRD export {NONE} fly end
...
end
using non conformant inheritance. That is all what I have said.
Nothing more, nothing less. I don't know what you have read from my
post to feel the need to correct my statements. ETL2 is from 1992 and
is therefore more than 15 years old. Is there a specification of
Eiffel between ETL2 and ECMA which I am not aware of?