comp.lang.ada
 help / color / mirror / Atom feed
* Standard packages
@ 1995-01-26  4:22 Paul Quinn
  1995-01-30 18:38 ` Theodore E. Dennison
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Quinn @ 1995-01-26  4:22 UTC (permalink / raw)



I just started programming in ADA.  My major problem is that the text book
for my course (Programming in Ada by Barnes) doesn't have a list
of the standard packages.  I keep wasting my time looking for the
packages.  Right now I need that package to do mod in integers.


I was wondering if anyone know a place where I can get a list of standard
packages?  Does GNAT support all the standard packages that are
used?

Could anyone recommend a better book?

--
________
Paul Quinn
p_quinn@ece.concordia.ca
Computer Science: Systems Architecture
Concordia University
Montreal, QC, CANADA
--------



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

* Re: Standard packages
  1995-01-26  4:22 Standard packages Paul Quinn
@ 1995-01-30 18:38 ` Theodore E. Dennison
  0 siblings, 0 replies; 6+ messages in thread
From: Theodore E. Dennison @ 1995-01-30 18:38 UTC (permalink / raw)


p_quinn@ECE.Concordia.CA (Paul Quinn) wrote:
>
> 
> I just started programming in ADA.  My major problem is that the text book
> for my course (Programming in Ada by Barnes) doesn't have a list
> of the standard packages.  I keep wasting my time looking for the
> packages.  Right now I need that package to do mod in integers.
> 
> 
> I was wondering if anyone know a place where I can get a list of standard
> packages?  Does GNAT support all the standard packages that are
> used?
> 

Uhh, are you talking about doing something like:

  ...
    Num_Candybars : integer := 20;
  begin
    if (Num_Candybars mod 4 = 1) then
  ...

you ALWAYS have visibility to the "mod" operation (for INTEGER).
let me repeat:
You ALWAYS have visibility to the "mod" operation (for integer).

I suspect you have some kind of "type"ing problem. For example 
the following is NOT legal:

  ...
    Num_Candybars : integer := 20;
    type Camshaft_Count is new integer;
    Num_Camshafts : Camshaft_Count := 4;
  begin
     if (Num_Candybars mod Num_Camshafts = 3) then
  ...

"mod"ing Candybars to Camshafts is like comparing apples to oranges
 :-)

HaHaHa. I kill me!

T.E.D.

T.E.D.



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

* Standard Packages
@ 2001-04-19 20:18 Jason King
  2001-04-19 20:51 ` Ted Dennison
  2001-04-20 18:34 ` Laurent Guerby
  0 siblings, 2 replies; 6+ messages in thread
From: Jason King @ 2001-04-19 20:18 UTC (permalink / raw)


I'm new to ada but am familiar with a lot of other languages (
c/c++,pascal, oracle pl/sql etc.)
variables, control structures and user written packages are all pretty
clear to me.
The only issue I have is that I don't have a good reference for the
standard packages in the ada hierarchy.
Maybe I'm dense, but the arm seems kind of obtuse to me.
There are lots of references to the c standard library on the web, is
there someplace I can find that same info for ada?
My immediate problem is how to read/write binary files.
I've found text_io but that doesn't look like quite what I want.
Thanks for any pointers given.




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

* Re: Standard Packages
  2001-04-19 20:18 Standard Packages Jason King
@ 2001-04-19 20:51 ` Ted Dennison
  2001-04-20 18:34 ` Laurent Guerby
  1 sibling, 0 replies; 6+ messages in thread
From: Ted Dennison @ 2001-04-19 20:51 UTC (permalink / raw)


In article <C32C0CFC70656CBF.9085D7CE760A6E5B.04457989B66A537F@lp.airnews.net>,
Jason King says...
>
>The only issue I have is that I don't have a good reference for the
>standard packages in the ada hierarchy.

The best I can give is the online LRM at
http://www.ada-auth.org/~acats/arm-html/RM-TOC.html . The Standard Libraries are
in section A. 

>Maybe I'm dense, but the arm seems kind of obtuse to me.

It can be a bit slow going. The best way to read the libraries is to read the
package specification first, then read the text underneath. Text_IO is sort of a
special case, in that there's a lot of extra verbage in the LRM about it. That's
probably what got you confused.

>My immediate problem is how to read/write binary files.
>I've found text_io but that doesn't look like quite what I want.

For non-text files, you'll want to use either Sequential_IO, Direct_IO, or
Streams.Stream_IO. Which you need depends on their contents, and how you want to
use them. 

Stream_IO is good for relatively unstructured data, or for when you want to read
in whole arrays of data at once. Sequential_IO is good for reading from a file
that consists of either a predefined record, or a series of them that you'd like
to read one after the other. Direct_IO is good for situations where you'd like
to use Sequential_IO, but you need to move the file pointer around manually.

---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html
          home email - mailto:dennison@telepath.com



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

* Re: Standard Packages
  2001-04-19 20:18 Standard Packages Jason King
  2001-04-19 20:51 ` Ted Dennison
@ 2001-04-20 18:34 ` Laurent Guerby
  2001-04-20 19:29   ` chris.danx
  1 sibling, 1 reply; 6+ messages in thread
From: Laurent Guerby @ 2001-04-20 18:34 UTC (permalink / raw)


Jason King <jhking@airmail.net> writes:
> There are lots of references to the c standard library on the web, is
> there someplace I can find that same info for ada?

The reference manual describes completely all the standard packages,
and this part of the standard is quite readable, it is on the web at:

<http://www.adapower.com/rm95/arm95_216.html>

> My immediate problem is how to read/write binary files.
> I've found text_io but that doesn't look like quite what I want.

May be Ada.Streams.Stream_IO will better suit your needs.

-- 
Laurent Guerby <guerby@acm.org>



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

* Re: Standard Packages
  2001-04-20 18:34 ` Laurent Guerby
@ 2001-04-20 19:29   ` chris.danx
  0 siblings, 0 replies; 6+ messages in thread
From: chris.danx @ 2001-04-20 19:29 UTC (permalink / raw)



> > There are lots of references to the c standard library on the web, is
> > there someplace I can find that same info for ada?
>
> The reference manual describes completely all the standard packages,
> and this part of the standard is quite readable, it is on the web at:
>
> <http://www.adapower.com/rm95/arm95_216.html>
>
> > My immediate problem is how to read/write binary files.
> > I've found text_io but that doesn't look like quite what I want.
>
> May be Ada.Streams.Stream_IO will better suit your
> needs.

If so you might want to check my example.  I put it up after I had some problems
with Streams.  The folks here helped me to get it working, so I thought I'd put
it up so others don't have similar difficulties.

I moved my page for a while cos' the server down and it's too slow anyway.
You'll find the new speedy site at http://members.tripod.com/willowplan


Hope this helps,
Chris Campbell







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

end of thread, other threads:[~2001-04-20 19:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-19 20:18 Standard Packages Jason King
2001-04-19 20:51 ` Ted Dennison
2001-04-20 18:34 ` Laurent Guerby
2001-04-20 19:29   ` chris.danx
  -- strict thread matches above, loose matches on Subject: below --
1995-01-26  4:22 Standard packages Paul Quinn
1995-01-30 18:38 ` Theodore E. Dennison

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