Re: type and subtype



Dmitry A. Kazakov wrote:

> On 24 Jul 2005 07:24:38 -0700, Douglas Chong wrote:
>
>> I'm a newbie in Ada 95.
>> Can some one tell me what is the different between type and subtype ?
>> Both are look the same for me. Thanks
>
> "A subtype of a given type is a combination of the type, a constraint on
> values of the type, and certain attributes specific to the subtype. The
> given type is called the type of the subtype. Similarly, the associated
> constraint is called the constraint of the subtype. The set of values of a
> subtype consists of the values of its type that satisfy its constraint.
> Such values belong to the subtype."

Please the ARM is not the easiest reading, and do we have easier text one
can point to:

http://en.wikibooks.org/wiki/Programming:Ada:Subtypes#Type_vs._Subtype

Martin

--
mailto://krischik@xxxxxxxxxxxxxxxxxxxxx
Ada programming at: http://ada.krischik.com

.



Relevant Pages

  • Re: MI is sloppy
    ... equivalent to disallowing the operations specific to that subtype. ... precondition is treated as a constraint check with Constraint_Error ... Constraint_Error propagation is the contracted behavior. ...
    (comp.lang.ada)
  • Re: more closed-world chatter
    ... constraint, the sets of elements for t1 and t2 must be disjoint, and ... only one most specific subtype. ... neither consideration exists in set theory. ... In a join of R1 and R2, the functional dependencies ...
    (comp.databases.theory)
  • Re: Reconsidering assignment
    ... An Integer object has some value - and only that. ... thing that Integer has is also subject for the constraint check. ... *every* modification of the Integer (or subtype of) ... The difference is that the exceptions are raised inside the subprogram, so the caller would need the details of the subprograms implementation to predict if an exception will be raised. ...
    (comp.lang.ada)
  • Re: [Ada] Subtype ohne range
    ... constraint on values of the type, ... to the subtype. ... subtype Dunkel is Farben ... Ich habe eine vage Erinnerung an ...
    (de.comp.lang.misc)
  • Re: types and subtypes
    ... If an Ada subtype adds a constraint to an Ada type, ... representation and be substitutable for the base one. ... Downward conversions additionally check the constraint. ...
    (comp.lang.ada)