Very basic question, but just reading through source code and trying to tell what the '
is for and how it differs from .
The '
character is used to introduce an attribute.
For example, Integer'Last
is the largest value of type Integer
, and Float'Digits
is the decimal precision of type Float
.
The complete list of language-defined attributes is in Annex K of the Ada Reference Manual.
It's also part of the syntax of qualified expressions, such as Some_Type'(expression)
.
The .
character is used, among other things, to introduce a record component name, such as Obj.Comp
, where Obj
is a record variable and Comp
is a component of that record.
Attributes are defined by the language or by the implementation; component names are defined when the record type is defined.
The apostrophe is also used to delimit character literals: 'x'
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With