This paper illustrates how some new Ada-95 features improve the versatility of scanning techniques. It will recall the definition of a scan, how scanning can be implemented in Ada-83, and what problems are associated with scans, notably in passing them as (generic) parameters. After that, we will discuss accesses to subprograms and show that they cannot become a worthwhile solution, and finally show an unexpected solution with tagged types used as a factorisation of properties rather than as an implementation of inheritance mechanisms.From some low-level point of view, both generic and file-like scannings can look like theoretical fashions that have no interest. The real question beyond such scannings is whether we accept the application of these programming principles that have emerged from decades of programming professional practice, such as weak coupling, abstraction and encapsulation. We argue that it is essential to study in depth all the consequences of these programming principles before assessing their interest in real life. We conjecture that encapsulated scans could be of enough interest to be much more widely used in industrial projects.Aside from industrial usages, scanning is a valid illustration of both tagged types and genericity, and we provided some suggested exercises for lecturers who would emphasize factorization of type properties and nested genericity or package parameters.
/lp/association-for-computing-machinery/what-s-new-for-scanning-with-ada-95-AY8YSdfp0O