2,420
questions
2
votes
1
answer
50
views
Dynamic Dispatching with Generic Packages in Ada
I am having trouble getting dynamic dispatching to work with Ada generics. Is there an elegant way (something better than conditions such as if X in A then ...) to have the generic Print procedure in ...
1
vote
1
answer
77
views
Adding wide character support breaks ncurses menu
I'm currently trying to create an ada program (this will be relevante later on) with a basic TUI.
To do so, I'm using ncurses, and more specifically, I'm interfacing with C as the ada bindings, ...
0
votes
0
answers
46
views
how to install gtkada on linux
i can't to install gtkada on my Linux PC. I tried look at the adacore's docs but I can't to understand. please someone can help me to install gtkada.i'm really blocked.
after to have download and ...
0
votes
0
answers
41
views
Adding hashmap elements to an unbounded_wide_string doesn't add it to the end
EDIT :
I'm... not too sure what I did, but I accidently solved my issue ?
While I was working on integrating comma support I decided to extract from the below function the conditions and put it in ...
2
votes
2
answers
104
views
How do I defer the full definition of a type?
Assume I have the following subprogram declared in the specification.
package Waiter is
type Time_Span is ????; -- Time_Span definition TBD...
procedure Wait (Period : Time_Span);
end Waiter;
...
2
votes
1
answer
99
views
Ada integer text guess error, how to fix?
So I was creating a guessing game for Ada but yeah it doesn't run. The error is in Line 25.
It says
guessing_game.adb:25:26: error: no candidate interpretations match the actuals:
with Ada.Text_IO;
...
1
vote
2
answers
176
views
Range check failed when using reduction expression in Ada
I tried to convert the array concatenation in function A to the new Ada 2022 reduction expression (see function B), but I get a range check failed error. What am I doing wrong?
with Ada.Text_IO;
...
2
votes
2
answers
88
views
How to iterate over a range with a custom step?
How can I iterate over a range in Ada with a custom step ?
For I in Integer'Range
loop
-- do something every 10 steps
end loop;
Can I define a subtype with specific step ?
1
vote
1
answer
79
views
Build the whitakers-words dictionary with Alire
First of all I want to apologize for something wrong I will say, I'm new to Ada and Alire.
I am trying to use the whitakers-words dictionary (https://github.com/mk270/whitakers-words) for a personal ...
1
vote
3
answers
126
views
How can I add an additional compiler option in an Alire .toml file?
For cross-compilation I need to specify the MCU type as a option to the Ada, C and theoretically C++ compiler.
How can I do that and in a way that it is also applied when building the dependencies?
At ...
5
votes
2
answers
120
views
Array of single bits in ada?
If I wrote
type u1 is range 0 .. 1;
type Index is range 0 .. 499999;
type U1Array is array(Index) of u1;
can I assume, that this will be a bit vector, which is packing the single u1 instances ...
3
votes
2
answers
111
views
Alias usage in Ada language
Package pack1 is
Type int_acc_type is access all integer;
End pack1;
--Local procedure
with pack1;
Procedure main is
Int_acc : pack1.int_acc_type;
Int_var : aliased integer;
Begin
Int_acc ...
0
votes
1
answer
129
views
How to avoid circular dependencies in Ada?
I have two packages called Passenger and Booking. They have a one to many relationship. I encountered a circular dependency error when I tried to do with in both of their files. I then tried limited ...
2
votes
2
answers
104
views
Subtype of string containing only hex characters in Ada
How can I define a subtype of String that allows only hex characters to be used? Here is my attempt, but I fail at the subtype definition:
subtype Hex_Character is Character
with Static_Predicate =&...
0
votes
0
answers
86
views
How to build SSL enabled for Ada Web Server?
I'm trying to get HTTPS requests working with Ada Web Server (AWS) found at https://github.com/AdaCore/aws/tree/master
I'm on Windows 11 and I don't understand how to make a build of the library and ...