Questions tagged [ada]

Ada is a structured, statically typed, imperative, wide-spectrum, and object-oriented high-level computer programming language, extended from Pascal and other languages.

Ada is a structured, statically typed, imperative, wide-spectrum, and object-oriented high-level computer programming language, extended from Pascal and other languages.Wikipedia

New to Ada?

Welcome! For learning any language, starting off with a good book is highly recommended. Ada is no different. Ada is different however in the number and quality of online resources available for free. A good starting point is the list of Ada Books On-Line. Once you have some basic learning under your belt, many find Ada LRM to be all the reference they ever need. The Ada Information Clearinghouse also provides a lot of useful links for learning Ada.

If you are looking for a good compiler, GNAT is a production-quality GCC-based Ada compiler that is freely available for Windows, OS X, and Linux; more here. Support and more platforms are available from AdaCore. If you want a more Windows-native compiler, Aonix ObjectAda uses the Microsoft linker, so it can be easier to use in an integrated Windows environment.

Versions

There are multiple versions of the language, named based on the year the ISO standardized the language. Thus there currently are Ada83, Ada95, Ada2005 and Ada2012. Any of those can be referenced as Ada, although the term is more appropriate for the latest version of the language.

Have a question?

When you ask a question, be sure to include any relevant source code. Try to keep the code as minimalist as possible while still reproducing the problem; often the problem will be found during the process. If there are any compiler errors, be sure to indicate:

  • Which compiler you are using?
  • Exactly what errors are shown?
  • On which lines do they occur (mark the lines with comment)?

It is recommended to enable syntax highlighting in the source code that you add to the question. Use the following syntax:

``` lang-ada
-- Ada source code goes here
```

External FAQs

Other External Resources

2354 questions
1
vote
2 answers

Using Ada.Text_IO.Integer_IO

I'm trying to write the following program: with Ada.Text_IO; procedure Main is type T is range 0 .. 18; package IO is new Ada.Text_IO.Integer_IO (T); begin IO.Put (1); end Main; But when I try compiling, I get the following error…
rid
  • 61,078
  • 31
  • 152
  • 193
1
vote
2 answers

In Ada generic packages

In Ada Generic packages if I have a package that deals with any element you put in, if I would want to demonstrate that the package is working, would I have to run two separate client programs to show Integer and then Float, or could I do all that…
j.Shry
  • 29
  • 5
1
vote
2 answers

Ada package body not compiling

package Bird_Package is type Bird_Type is tagged private; procedure Init(A_Bird : out Bird_Type; Name : in String); function Name(A_Bird : in Bird_Type) return String; function Call(A_Bird : in Bird_Type) return String; …
j.Shry
  • 29
  • 5
1
vote
2 answers

wxWidgets for Ada?

In Lua-scripting I found wxWidgets (wxLua) library very useful, so I'd wanted to found binding for Ada and GNAT Programming Studio 2010 (4.4.1) - does it exist at all and maybe somebody know how to link it with GNAT? Only one I found is wxAda, which…
Archinamon
  • 171
  • 1
  • 12
1
vote
1 answer

Performance: Compare records ot slice array?

I have the following records: type Items is record Feature_A : Type_Feature_A; Feature_B : Type_Feature_B; Feature_C : Type_Feature_C; Feature_D : Type_Feature_D; end record; type My_Array is array (1 .. 10) of…
user2205092
  • 83
  • 1
  • 7
1
vote
1 answer

Building static stand alone library with gprbuild

I am trying to build a static library using gprbuild. The library does not have a main (which is written in C and linked in later stage) and must be self contained as far as I understand the gpr term for this is "stand-alone" which means, it will…
Artium
  • 5,147
  • 8
  • 39
  • 60
1
vote
1 answer

Ada: Serial port, String to Stream_element_array

when 'B' |'b' => cons.Put_Line("Enter text - less than 20 chars: "); cons.Get_Line(Item => st, Last => m); --buffer_ser'Write(st,m); ser.Write(Port => S_Port, …
DonkeyOaty
  • 80
  • 9
1
vote
1 answer

Ada Compilation Print full path

Simple question. I am compiling an ada program with gnat. The gcc command ends up looking like gcc -c -Ia -Ibunch -Iof -Iincludes -I- -o /some/object/file.o /some/source/file.adb however the error format consists of just file.adb:line:offset:…
LambdaBeta
  • 1,479
  • 1
  • 13
  • 25
1
vote
0 answers

Ada: Error in GetRegistryEntry open AdaGIDE

Yesterday I was using AdaGIDE and all was fine. Today... not so much. Everytime I attempt to open AdaGIDE this message pops up: Error in GetRegistryEntry open AdaGIDE code: 0 I'll click OK then get this: Error in GetRegistryEntry query code:…
Kelsey
  • 11
  • 1
1
vote
2 answers

Ada Makefile Binding Issue

I am working on a project in Ada and would like a custom makefile (as I intend to interface with c and python eventually and am very familiar with makefile syntax and not at all familiar with gnatmake project syntax). I messed around with custom…
LambdaBeta
  • 1,479
  • 1
  • 13
  • 25
1
vote
1 answer

How to force accurate indices on a private type

I have a private type that internally uses a 2 dimensional array, while doing additional processing whenever the elements of that array are set. My package looks something like this: with MyElements; generic Width, Height : Positive; package…
LambdaBeta
  • 1,479
  • 1
  • 13
  • 25
1
vote
2 answers

What is wrong with this if else statement?

I'm working with Ada, and the lack of braces on the control statements have been getting me a bit mixed up. I have written the following if-else statement: if i = 1 then largest := nextInteger; else if i = 2 then if nextInteger > largest…
mpowell48
  • 43
  • 8
1
vote
1 answer

Zero out Ada 2D array of given size

I have M : array (1..3, 1.. 3) of Integer := ((0, 0, 0), (0, 0, 0), (0, 0, 0)); I am looking to convert the size of this to be user-determined, i.e., the new array would look something like M : array (1 .. user_size, 1 .. user_size) of ... The…
Jud
  • 1,324
  • 3
  • 24
  • 47
1
vote
3 answers

Limit functions to be called by specific other functions in Ada

Suppose I have a procedure that I want to only have called by another specific procedure. Is it possible to force restrictions on that procedure so that it can only be referenced by the specified calling procedure? Really what I'm wanting to know,…
onaclov2000
  • 5,741
  • 9
  • 40
  • 54
1
vote
1 answer

Waiting until an item arrives in a protected object

Okay, Ada tasking is quite new and confusing to me. I have a classic problem with a protected object that stores events by IDs as key. The idea is that a producer task fills it with incoming events and one or more consumer tasks need to wait until…