Rationale for Ada 2012

John Barnes
Contents   Index   References   Search   Previous   Next 

Chapter 3: Expressions

This chapter describes the introduction of more flexible forms of expressions in Ada 2012.
There are four new forms of expressions. If expressions and case expressions define a value and closely resemble if statements and case statements. Quantified expressions take two forms using for all and for some to return a Boolean value. Finally, expression functions provide a simple means of parameterizing an expression without the formality of providing a function body.
These more flexible forms of expressions will be found invaluable in formulating contracts such as preconditions. It is interesting to note that Ada now has conditional expressions over 50 years after their introduction in Algol 60.

Contents   Index   References   Search   Previous   Next 
© 2011, 2012, 2013 John Barnes Informatics.
Sponsored in part by:
The Ada Resource Association:


and   Ada-Europe: