While I try to get my EiffelStudio installation working again

17 views
Skip to first unread message

williams Lima

unread,
Aug 15, 2018, 11:42:15 AM8/15/18
to Eiffel Users
Unfortunately, my EiffelStudio installation is messed up. While I try to get it working again
I would like to share some doubts that I have about Eiffel's constrained genericity
and also about Stroustrup Concept mechanism for C++.

The first thing is about constrained genericity and catcall problem.
If I'm right, constrained genericity requires inheritance. In this case, a class can
only be used as an actual type if it inherits from the classes defined
in the constraints list in the definition of the respective generic class.
But that introduces the catcall problem. Inheritance seems to not be a good design.

So I wonder if the solution to this problem should be something in the lines of Stroustrup Concept
framework. 
In other words, types should be detached from general properties like being comparable, for example.
The compiler would do type checking properly.

Maybe I can write a Blog article about it as I gain a better understanding of these issues.

regards
Williams



Larry Rix

unread,
Aug 15, 2018, 12:23:46 PM8/15/18
to Eiffel Users
I believe it is Multiple Inheritance that introduces the notion of a CAT call (Certified Attachment Type) problem, in which Generics participate. Stated another way—one may have a CAT call issue even without involving Generics at all.

Can someone verify if that statement (above) is true?

Alexander Kogtenkov

unread,
Aug 15, 2018, 12:37:55 PM8/15/18
to eiffel...@googlegroups.com
CAT-calls do not arise from inheritance or constrained genericity, but from a combination of covariant arguments and polymorphism. This issue is not unique to Eiffel. The same happens with Java array types, where the run-time performs checks whether an element inserted in an array is of an expected type or not. This is similar to Eiffel run-time checks for CAT-calls. The difference is that for types other than arrays, Java does not allow for covariant arguments, so no such checks are needed for user-defined types.

There is a solution to the CAT-call issue. It prevents a combination of polymorphism with covariance. Only one of those is allowed at a time, not both. The solution is partially implemented in EiffelStudio, but complete implementation requires essential changes to existing libraries. There is an ongoing work on the libraries in this direction. As you expect, to avoid severe breaking changes, they are integrated gradually to let users update the code piece-by-piece if needed. This is a slow and complicated process.

Regards,
Alexander Kogtenkov


williams Lima <dwillia...@gmail.com>:

Larry Rix

unread,
Aug 15, 2018, 1:21:36 PM8/15/18
to eiffel...@googlegroups.com
Thanks, Alexander!

This updates me from what I knew 10 years ago. I think the reason my memory took me to the higher concept of Inheritance is because covariance is matter related to it. 

For example, I found a documentation subsection on covariance within the discussion of Eiffel Inheritance located here.

The documentation also has a section for Cat-calls. In that write-up is a statement nearly identical to yours (above):

"The capabilities of polymorphism combined with covariance provide for powerful and flexible modeling. Under certain conditions, though, this flexibility can lead to problems.

In short, you should be careful to avoid polymorphic catcalls. The call part of catcall means feature call. The cat part is an acronym for Changed Availability or Type."

NOTE: I was incorrect to call it CAT = Change Attachment Type -- it is Change IN Availability OR Type (i.e. CAT).


Kindest Regards,

Larry

Larry Rix
Moonshot Software
Rocket science for everyone!
Savannah, GA

--
You received this message because you are subscribed to the Google Groups "Eiffel Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-users+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/eiffel-users.
For more options, visit https://groups.google.com/d/optout.

Larry Rix

unread,
Aug 15, 2018, 1:24:00 PM8/15/18
to eiffel...@googlegroups.com
ALSO—it is good to know that a solution to Catcalls has been found. The last I knew, the solution was still unknown. So, I am delighted to know the solution is known and on its way to being implemented!

Larry Rix
Moonshot Software
Rocket science for everyone!
Savannah, GA

On Wed, Aug 15, 2018 at 12:37 PM, 'Alexander Kogtenkov' via Eiffel Users <eiffel...@googlegroups.com> wrote:

--
Reply all
Reply to author
Forward
0 new messages