Skip to content

Commit 201f22f

Browse files
committed
reformat slide that was a bit large
1 parent 91a718f commit 201f22f

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

courses/fundamentals_of_ada/030_basic_types/11-subtypes_full_picture.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,19 +253,22 @@ Idiom: Subtypes as Local Constraints
253253

254254
Do not use for checks that should **always** happen, even in production.
255255

256+
* Constrain input range
257+
256258
.. code:: Ada
257259
258-
subtype Incrementable_Integer is Integer
259-
range Integer'First .. Integer'Last - 1;
260+
subtype Incrementable_Integer is Integer range Integer'First .. Integer'Last - 1;
260261
261262
function Increment (I : Incrementable_Integer) return Integer;
262263
264+
* Constrain output range
265+
263266
.. code:: Ada
264267
265-
subtype Valid_Fingers_T is Integer
266-
range 1 .. 5;
267-
Fingers : Valid_Fingers_T
268-
:= Prompt_And_Get_Integer ("Give me the number of a finger");
268+
subtype Valid_Fingers_T is Integer range 1 .. 5;
269+
Fingers : Valid_Fingers_T := Prompt_And_Get_Integer ("Give me the number of a finger");
270+
271+
* Constrain array index
269272

270273
.. code:: Ada
271274

0 commit comments

Comments
 (0)