ada

Dynamic Dispatching in Ada with Access Types

江枫思渺然 提交于 2021-01-29 03:52:22
问题 I am trying to create a package that has Dynamic dispatching using access types. I have achieved Dynamic Dispatching using Class Types using This Q/A as a guide. I keep getting a compilation error that says: cannot call abstract subprogram. This makes me think that the compiler either doesnt recognize the specialized subprogram, or doesnt recognize the type as a specialized type. But both seem right to me... I dont get it. main.2.ada with Ada.Text_IO; with Animal.Cat; procedure Main is Tabby

Ada encapsulation and private types

蹲街弑〆低调 提交于 2021-01-28 12:12:11
问题 From the compiler's point of view, what's the difference between declaring an Ada type in a package spec or doing it inside the body? 回答1: Generally it is a good practice to make declarations (of types, but also other items like constants or subprograms) the most local possible. In your case if the type is used only in the body and not for users of your package specification (even as private type), put it in the body. Furthermore, if it is used only in a subprogram of the body, put it in that

Adacore GNATCOLL library not installing on CentOS 8

江枫思渺然 提交于 2021-01-28 11:15:19
问题 I have recently been using the gnatcoll library on CentOS 7 and Debian 9, the installation process for both operating systems has been the same. When I attempt this install on CentOS 8, I recieve the following error msg: [lloyd@localhost sql]$ PATH=/home/lloyd/opt/GNAT/2020/bin:$PATH [lloyd@localhost sql]$ make setup [lloyd@localhost sql]$ make gprbuild -p -m --target=x86_64-linux -j0 -XGNATCOLL_VERSION=0.0 -XBUILD=PROD -XLIBRARY_TYPE=static -XXMLADA_BUILD=static -XGPR_BUILD=static \ gnatcoll

Unable to get the Ada scrolling text demo working on the microbit on GNAT 2019 community edition

谁都会走 提交于 2021-01-28 09:00:29
问题 I'm trying to run the demo described here: https://blog.adacore.com/ada-on-the-microbit I followed the tutorial's directions carefully. I did install the 2019 versions of the software instead of the 2018 versions. GPS seems to be installed and working on my windows 7 machine. The project builds but pyocd-flashtool can't seem to recognize my microbit. It reports it as a "generic cortex_m" and throws an exception. Here's the output: gprbuild --target=arm-eabi -d -PC:\Domains\ada\microbit

Unable to get the Ada scrolling text demo working on the microbit on GNAT 2019 community edition

梦想的初衷 提交于 2021-01-28 08:40:45
问题 I'm trying to run the demo described here: https://blog.adacore.com/ada-on-the-microbit I followed the tutorial's directions carefully. I did install the 2019 versions of the software instead of the 2018 versions. GPS seems to be installed and working on my windows 7 machine. The project builds but pyocd-flashtool can't seem to recognize my microbit. It reports it as a "generic cortex_m" and throws an exception. Here's the output: gprbuild --target=arm-eabi -d -PC:\Domains\ada\microbit

Package bodies and main programs. Simple assignment (Ada)

孤人 提交于 2021-01-28 03:21:05
问题 Im stuck in Ada. I'm supposed to create a package with a specific Flag_Type that can be written to and read in order to print a simple flag. Id like to think Ive managed to make the package ads and the package body adb right but I struggle with the commands for the main program. First is first, the output is supposed to look like this: Enter the flag name: Italys flag Enter the flag height: 2 Enter the stripes width: 3 Enter the flags colors: GWR Italys flag +---------+ |GGGWWWRRR| |GGGWWWRRR

Package bodies and main programs. Simple assignment (Ada)

给你一囗甜甜゛ 提交于 2021-01-28 01:34:11
问题 Im stuck in Ada. I'm supposed to create a package with a specific Flag_Type that can be written to and read in order to print a simple flag. Id like to think Ive managed to make the package ads and the package body adb right but I struggle with the commands for the main program. First is first, the output is supposed to look like this: Enter the flag name: Italys flag Enter the flag height: 2 Enter the stripes width: 3 Enter the flags colors: GWR Italys flag +---------+ |GGGWWWRRR| |GGGWWWRRR

Updating the Compiler for the GPS Community Edition 2019 IDE

左心房为你撑大大i 提交于 2021-01-27 14:01:30
问题 I've recently started working on a project that requires my complier to be above GNAT 4.8.5 - When I go to: Help > About You can see that the version I'm using is 4.8.5 Also, when I run the gnatls -v command, I can see this... [parallels@localhost ~]$ gnatls -v GNATLS 4.8.5 20150623 (Red Hat 4.8.5-39) Copyright (C) 1997-2013, Free Software Foundation, Inc. Source Search Path: <Current_Directory> /usr/lib/gcc/x86_64-redhat-linux/4.8.5/adainclude/ Object Search Path: <Current_Directory> /usr

Can't prove seemingly trivial equality in Ada Spark

别说谁变了你拦得住时间么 提交于 2021-01-27 07:30:59
问题 So I have those two files. testing.ads package Testing with SPARK_Mode is function InefficientEuler1Sum2 (N: Natural) return Natural; procedure LemmaForTesting with Ghost, Post => (InefficientEuler1Sum2(0) = 0); end Testing; and testing.adb package body Testing with SPARK_Mode is function InefficientEuler1Sum2 (N: Natural) return Natural is Sum: Natural := 0; begin for I in 0..N loop if I mod 3 = 0 then Sum := Sum + I; end if; if I mod 5 = 0 then Sum := Sum + I; end if; if I mod 15 = 0 then

Can't prove seemingly trivial equality in Ada Spark

北战南征 提交于 2021-01-27 07:30:58
问题 So I have those two files. testing.ads package Testing with SPARK_Mode is function InefficientEuler1Sum2 (N: Natural) return Natural; procedure LemmaForTesting with Ghost, Post => (InefficientEuler1Sum2(0) = 0); end Testing; and testing.adb package body Testing with SPARK_Mode is function InefficientEuler1Sum2 (N: Natural) return Natural is Sum: Natural := 0; begin for I in 0..N loop if I mod 3 = 0 then Sum := Sum + I; end if; if I mod 5 = 0 then Sum := Sum + I; end if; if I mod 15 = 0 then