❌ About FreshRSS

Normal view

There are new articles available, click to refresh the page.
Before yesterdayCommunities

Explaining Ada’s Features

[Archive Link]

Explaining Ada’s Features

Somebody was having trouble understanding some of Ada’s features —Packages, OOP, & Generics— so I wrote a series of papers explaining them. One of the big problems with his understanding was a mental model that was simply inapplicable (read wrong), and getting frustrated because they were judging features based on their misunderstanding.

The very-simple explanation of these features is:

  1. The Package is the unit of code that bundles types and their primitive-operations together, (this provides a namespace for those entities it contains);
  2. Ada’s Object Oriented Programming is different because:
    1. It uses packages bundle types and their subprograms,
    2. It clearly distinguishes between “a type” and “a type and anything derived therefrom“,
    3. The way to distinguish between a type and the set of derived types is via use of the 'Class attribute of the type, as in Operation'Class.
  3. Ada’s generics were designed to allow:
    1. an instantiation to be checked against the formal parameters and, generally, any complying candidate would be valid; and
    2. that the implementation could only program against the properties that were explicitly given or those implicitly by the properties of those explicitly given (e.g. attributes); and
    3. that generic formal parameters for types should generally follow the same form of those used in the type-system for declarations, modulo the Box-symbol which means “whatever”/”unknown”/”default”.

Anyway, here are the papers:

Explaining Ada’s Packages

[Direct Download|Archive]

Explaining Ada’s Object Oriented Programming

[Direct Download|Archive]

Explaining Ada’s Generics

[Direct Download|Archive]
(Original revision: Here.)

submitted by /u/OneWingedShark
[link] [comments]