comp.lang.ada
 help / color / mirror / Atom feed
* Re: Newbie question about types
  1999-11-22  0:00 Newbie question about types David Powell
                   ` (2 preceding siblings ...)
  1999-11-22  0:00 ` Preben Randhol
@ 1999-11-22  0:00 ` Matthew Heaney
  1999-11-23  0:00   ` Riyaz Mansoor
  3 siblings, 1 reply; 6+ messages in thread
From: Matthew Heaney @ 1999-11-22  0:00 UTC (permalink / raw)


In article <81bn5j$sv8$1@nntp9.atl.mindspring.net> , "David Powell" 
<powellboys@mindpring.com> wrote:

> I am a new Ada (notice the spelling.  you guys seem to be pretty touchy
> about it) and am working through a book.  The author makes many references
> to enumeration types and numeric types without distinguishing the two.  Any
> help on what an enumeration type is as apposed to a numeric type would be
> appreciated.

type Enumeration_Type is (A, B, C);

type Integer_Type is range 1 .. 10;

type Modular_Type is mod 256;

type Float_Type is digits 6 range -pi .. pi;

type Fixed_Type is delta 0.01 range 0.0 .. 1.00;


ie

  type Gender_Type is (Male, Female);

  type Height_In_Feet_Type is range 0.0 .. 20.0;




--
The theory of evolution is quite rightly called the greatest unifying
theory in biology.  The diversity of organisms, similarities and
differences between kinds of organisms, patterns of distribution and
behavior, adaptation and interaction, all this was merely a bewildering
chaos of facts until given meaning by the evolutionary theory.

Populations, Species, and Evolution
Ernst Mayr




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Newbie question about types
  1999-11-22  0:00 Newbie question about types David Powell
@ 1999-11-22  0:00 ` Larry Kilgallen
  1999-11-22  0:00 ` BSCrawford
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Larry Kilgallen @ 1999-11-22  0:00 UTC (permalink / raw)


In article <81bn5j$sv8$1@nntp9.atl.mindspring.net>, "David Powell" <powellboys@mindpring.com> writes:
> I am a new Ada (notice the spelling.  you guys seem to be pretty touchy
> about it) and am working through a book.  The author makes many references
> to enumeration types and numeric types without distinguishing the two.  Any
> help on what an enumeration type is as apposed to a numeric type would be
> appreciated.

It sounds like what you need most is a new book (providing the one you
have is an introductory text).  Please share the name of the book you
are now using, so we can steer clear.

Larry Kilgallen




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Newbie question about types
  1999-11-22  0:00 Newbie question about types David Powell
  1999-11-22  0:00 ` Larry Kilgallen
@ 1999-11-22  0:00 ` BSCrawford
  1999-11-22  0:00 ` Preben Randhol
  1999-11-22  0:00 ` Matthew Heaney
  3 siblings, 0 replies; 6+ messages in thread
From: BSCrawford @ 1999-11-22  0:00 UTC (permalink / raw)


David, 

An enumeration type declaration specifies a list of distinct 
items, enclosed in parentheses. The items are identifiers or 
character literals. In either case the legal values of the 
type are referred to as "enumeration literals." Each of these 
values has a "position number" corresponding to its position 
in the list  Enumeration types have attributes  T'First, T'Last, 
T'Range, T'Pred, T'Succ, T'Min, T'Max, T'Image, T'Wide_Image, 
T'Value, T'Wide_Value, T'Pos, and T'Val

Numeric types specify sets of numerical values and include 
integer types, floating-point types, and fixed-point types. 
Generally speaking, numeric types have the same attributes as 
enumeration types. However, floating-point and fixed-point 
types do not have the T'Pos and T'Val attributes. Some numeric 
types have additional attributes. For example, fixed-point types 
have the attributes T'Delta, and T'Small.

(Congratulations on the proper spelling of Ada, and good 
luck with our favorite language. :-)

Bard Crawford
Stage Harbor Software




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Newbie question about types
@ 1999-11-22  0:00 David Powell
  1999-11-22  0:00 ` Larry Kilgallen
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: David Powell @ 1999-11-22  0:00 UTC (permalink / raw)


I am a new Ada (notice the spelling.  you guys seem to be pretty touchy
about it) and am working through a book.  The author makes many references
to enumeration types and numeric types without distinguishing the two.  Any
help on what an enumeration type is as apposed to a numeric type would be
appreciated.






^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Newbie question about types
  1999-11-22  0:00 Newbie question about types David Powell
  1999-11-22  0:00 ` Larry Kilgallen
  1999-11-22  0:00 ` BSCrawford
@ 1999-11-22  0:00 ` Preben Randhol
  1999-11-22  0:00 ` Matthew Heaney
  3 siblings, 0 replies; 6+ messages in thread
From: Preben Randhol @ 1999-11-22  0:00 UTC (permalink / raw)


"David Powell" <powellboys@mindpring.com> writes:

| I am a new Ada (notice the spelling.  you guys seem to be pretty touchy
| about it) and am working through a book.  The author makes many references
| to enumeration types and numeric types without distinguishing the two.  Any
| help on what an enumeration type is as apposed to a numeric type would be
| appreciated.

For a small intro:

http://www.adahome.com/Tutorials/Lovelace/s6s1.htm
and
http://www.adahome.com/Tutorials/Lovelace/s6s4.htm

-- 
Preben Randhol                     "Marriage is when you get to keep
[randhol@pvv.org]                   your girl and don't have to give
[http://www.pvv.org/~randhol/]      her back to her parents." (Eric, 6)




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Newbie question about types
  1999-11-22  0:00 ` Matthew Heaney
@ 1999-11-23  0:00   ` Riyaz Mansoor
  0 siblings, 0 replies; 6+ messages in thread
From: Riyaz Mansoor @ 1999-11-23  0:00 UTC (permalink / raw)


heaney,

> type Enumeration_Type is (A, B, C);
>
> type Integer_Type is range 1 .. 10;
>
> type Modular_Type is mod 256;
>
> type Float_Type is digits 6 range -pi .. pi;
>
> type Fixed_Type is delta 0.01 range 0.0 .. 1.00;
>
>   type Gender_Type is (Male, Female);
>
>   type Height_In_Feet_Type is range 0.0 .. 20.0;

hey thanx. i just figured out a mistake i've been making. :)

the moral of the story is : you can never learn everything. heheh






^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1999-11-23  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-22  0:00 Newbie question about types David Powell
1999-11-22  0:00 ` Larry Kilgallen
1999-11-22  0:00 ` BSCrawford
1999-11-22  0:00 ` Preben Randhol
1999-11-22  0:00 ` Matthew Heaney
1999-11-23  0:00   ` Riyaz Mansoor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox