Skip to content

Commit 621f391

Browse files
committed
030: add tips, notes, and warnings
1 parent 421634a commit 621f391

File tree

5 files changed

+31
-20
lines changed

5 files changed

+31
-20
lines changed

courses/fundamentals_of_ada/030_basic_types/01-introduction.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Strong Typing
1515

1616
- **Check** of values and operations
1717
- Easy for a computer
18-
- Developer can focus on **earlier** phase: requirement
18+
19+
.. tip:: Developer can focus on **earlier** phase: requirement
1920

2021
----------------------------------------
2122
Strongly-Typed Vs Weakly-Typed Languages
@@ -198,7 +199,8 @@ Type Model Run-Time Costs
198199
* **Same performance** for identical programs
199200

200201
- Run-time type checks can be disabled
201-
- Compile-time check is *free*
202+
203+
.. note:: Compile-time check is *free*
202204

203205
.. container:: columns
204206

courses/fundamentals_of_ada/030_basic_types/02-discrete_numeric_types.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ Predefined Signed Integer Types
5151
- Guaranteed ranges: :ada:`Short_Integer` ``<=`` :ada:`Integer` ``<=`` :ada:`Long_Integer`
5252
- Ranges are all **implementation-defined**
5353

54-
* Portability not guaranteed
54+
.. warning::
5555

56-
- But may be difficult to avoid
56+
Portability not guaranteed
57+
58+
* But may be difficult to avoid
5759

5860
---------------------------------
5961
Operators for Signed Integer Type
@@ -67,12 +69,13 @@ Operators for Signed Integer Type
6769
:multiplying operator: :ada:`* | / | mod | rem`
6870
:highest precedence operator: :ada:`** | abs`
6971

70-
* *Note*: for exponentiation :ada:`**`
72+
.. note::
7173

72-
- Result will be a signed integer
73-
- So power **must** be :ada:`Integer` ``>= 0``
74+
Exponentiation :ada:`**` result will be a signed integer
7475

75-
* Division by zero |rightarrow| :ada:`Constraint_Error`
76+
- |rightarrow| power **must** be :ada:`Integer` ``>= 0``
77+
78+
.. warning:: Division by zero |rightarrow| :ada:`Constraint_Error`
7679

7780
------------------------
7881
Signed Integer Overflows

courses/fundamentals_of_ada/030_basic_types/02-discrete_numeric_types_with_mod.rst

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ Predefined Signed Integer Types
5151
- Guaranteed ranges: :ada:`Short_Integer` ``<=`` :ada:`Integer` ``<=`` :ada:`Long_Integer`
5252
- Ranges are all **implementation-defined**
5353

54-
* Portability not guaranteed
54+
.. warning::
5555

56-
- But may be difficult to avoid
56+
Portability not guaranteed
57+
58+
- But may be difficult to avoid
5759

5860
---------------------------------
5961
Operators for Signed Integer Type
@@ -67,12 +69,13 @@ Operators for Signed Integer Type
6769
:multiplying operator: :ada:`* | / | mod | rem`
6870
:highest precedence operator: :ada:`** | abs`
6971

70-
* *Note*: for exponentiation :ada:`**`
72+
.. note::
73+
74+
Exponentiation :ada:`**` result will be a signed integer
7175

72-
- Result will be a signed integer
73-
- So power **must** be :ada:`Integer` ``>= 0``
76+
- |rightarrow| power **must** be :ada:`Integer` ``>= 0``
7477

75-
* Division by zero |rightarrow| :ada:`Constraint_Error`
78+
.. warning:: Division by zero |rightarrow| :ada:`Constraint_Error`
7679

7780
------------------------
7881
Signed Integer Overflows
@@ -119,7 +122,7 @@ Modular Types
119122
* **Unsigned** values
120123
* Adds operations and attributes
121124

122-
* Typically **bit-wise** manipulation
125+
.. note:: Typically **bit-wise** manipulation
123126

124127
* Syntax
125128

courses/fundamentals_of_ada/030_basic_types/07-real_types.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,12 @@ Predefined Floating Point Types
7777
- :ada:`Long_Float` ``>= 11`` digits
7878

7979
* General-purpose
80-
* Best to **avoid** predefined types
8180

82-
- Loss of **portability**
83-
- Easy to avoid
81+
.. tip::
82+
83+
It is best, and easy, to **avoid** predefined types
84+
85+
- Loss of **portability**
8486

8587
-------------------------------
8688
Floating Point Type Operators
@@ -140,7 +142,8 @@ Numeric Types Conversion
140142
* Special rule: can always convert between numeric types
141143

142144
- Explicitly
143-
- :ada:`Float` |rightarrow| :ada:`Integer` causes **rounding**
145+
146+
.. warning:: :ada:`Float` |rightarrow| :ada:`Integer` causes **rounding**
144147

145148
.. code:: Ada
146149

courses/fundamentals_of_ada/030_basic_types/10-subtypes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Subtype
1616
1717
- :ada:`Type_Name` is an existing :ada:`type` or :ada:`subtype`
1818

19-
* If no constraint |rightarrow| type alias
19+
.. note:: If no constraint |rightarrow| type alias
2020

2121
-----------------
2222
Subtype Example

0 commit comments

Comments
 (0)