Next language will be Prolog -- download SWI prolog from the Web or GNU prolog
There will be another
Additional notes about example programs
when
you output an integer in
ada.integer_text_io.put (6);
ada.integer_text_io.put (item => 6); -- this statement is identical to the statement above9
alternatively, you can control the number of spaces it uses
ada.integer_text_io.put (item => 6, width => 5);
=>
is called an arrow in
<>
is called a box in
--
subtype positive is integer
range 1.. integer’last;
The ada String type is declared as an unconstrained array
of characters;
--
Type string is array (positive range <>) of character;
--
a declaration of a string variable in
-- when a string
variable is declared it must be constrained
-- lowest index allowed is 1 because declaration specifies that
the range is positive
MyName : string(1..5);
-- a declaration of a
string constant -- doesn’t require
specification of range. Range is taken
from declaration
MyConstantString : constant String := “however
many characters in this string”;
-- a number of the examples show
-- user can define own exceptions
-- exceptions in
-- exception handlers begin with the reserved word exception
-- each individual handler begins with the reserved word when
-- after an exception
is handled, control leaves the block in which the exception occurred which is
why if the exception handler is inside a loop and
-- you don’t want to leave the loop after handling the exception you need a begin end pair around it