VECTOR [G -> {COMPARABLE, NUMERIC}]
Let's say we want VECTOR [G], where G is constrained to be both COMPARABLE and NUMERIC. That is use operators such as <,=, > as well as +, -, *, /.
Is this possible, and if so how is it done?
--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/eiffel-users/d35845a1-a524-4b5d-be86-2bcfb95737ban%40googlegroups.com.
-- SmartDevelopersUseUnderScoresInTheirIdentifiersBecause_it_is_much_easier_to_read
Because not all numeric is comparable. E.g. complex numbers.
Rosivaldo F Alves
To view this discussion on the web visit https://groups.google.com/d/msgid/eiffel-users/CYXPR08MB96100A47A749CE9885D2FC5DA0FB2%40CYXPR08MB9610.namprd08.prod.outlook.com.
Seems rational (so to speak), but maybe there should be a "plain vanilla numeric" that is comparable, and another "not so fast, buddy, numeric" that is not, and each of those a child of "even more abstract numeric" or some such thing.thanksR
Let me point again (in line with what Mischa Mengens also wrote) to my earlier response referring to the mathematical models, respectively ring (https://en.wikipedia.org/wiki/Ring_(mathematics)) and total order (https://en.wikipedia.org/wiki/Total_order). On the latter I think my discussion of order relations in the chapter on topological sort, chapter 15, of my Touch of Class book is a good introduction.
There may be a tendency to forget that a library is an embodiment of a theory of a certain target domain. A good library is a set of classes that correctly implements a well-thought-out theory. Much of the time when you start building the theory you have to invent, but when the target domain is mathematical, as here, it is wise to start with the kind of theorization and classification that mathematicians have performed over many decades and many iterations. Not necessarily to take them 100% for granted, but one must have pretty serious arguments before beginning to disagree with the likes of Cantor, Russell, Hilbert, Bourbaki et tutti quanti.
With best regards,
-- Bertrand Meyer
Latest book: Handbook of Requirements and Business Analysis, Springer, 2022
A treatise and textbook on requirements, see https://se.ethz.ch/requirements
To view this discussion on the web visit https://groups.google.com/d/msgid/eiffel-users/CYXPR08MB9610996D590A62097D04C001A0FB2%40CYXPR08MB9610.namprd08.prod.outlook.com.