A conical shaped article (approximately 40 cm high), made by sewing 2 nonwoven triangle shaped panels of red textile material together, with an applied trim of white colour at the base, and a white bobble at the top. The object in question was to be classified under CN code 6505 00 90 as 'headgear', and not under subheading 9505 10 90 as 'other articles for Christmas festivities', because textile articles that have a utilitarian function are excluded from Chapter 95, even when they have a festive design.
-- Santa Clause hat as described in an official EU document
While reading a philosophy book I suddenly realised that C++ ADL (Argument Dependent Lookup also called Koenig's lookup principle) is, surprisingly, aligned with Aristotle's way of viewing the world.
Concepts have been analysed ever since Plato and Aristotle. Plato believed that everything on this earth was a copy, even though imperfect, of a perfect exemplar in the world of ideas.
Aristotle came along and stated that everything had essential properties as well as accidental properties. Essential properties were, well, essential for the thing to be classified as just that thing. Accidental properties on the other hand could vary within a group of things having the same essential properties.
Now I'll stretch the terminology a little. By properties I don’t simply mean structural properties but also behavioural properties. So when viewing classes as models of concepts C++ supports the idea of accidental properties through ADL. Functions deemed not to be part of the class proper, but still considered part of the class interface, can be defined outside the class but within the same namespace in which the class lives. Modelling accidental properties through ADL is a good thing since it promotes loose coupling between classes and accidental properties.
Not bad for C++ to align with old Greek philosophy!
No comments:
Post a Comment