"Pascal Obry" wrote in message news:1520428274.2488.155.camel@obry.net... Le mercredi 07 mars 2018 à 02:52 -0800, Mehdi Saada a écrit : >> Why not writing everything in the specs then ? Maybe the original >> separation of specs and bodies is a mistake, in the light of recent >> tools requirements. > >The spec is what is exposed to other units. > >The body is implementation details. > >The separation is to me one of the most important point in Ada. I think >that all languages should have done that. It is an welcomed separation >for software engineer. Right. And note that the specification has always contained elements which are determined at runtime (that is, executed). For instance, even in Ada 83 you could have a subtype like: subtype Dyn is Natural range 1 .. Some_Function; and to properly export Dyn, one has to execute code. The various contracts (preconditions, postconditions, predicates, etc.) all contain some executable code, and it is necessary for callers to be able to understand those contracts. Expression functions help in this, while the bulk of the implementation should remain in the body. While the line separating the specification and the implementation is very important, it is also a blurry line (and always has been). Also note that the private part is effectively part of the body (that is, the implementation part), and that is where 95% of expression functions end up. So while they are physically in the source code of the specification, they still belong to the body. (The private part, after all, is a hack to ease implementation. Expression functions are similar in a way, although it is not the Ada implementation that they are intended to help.) Randy.