ada

Fundamentals of Ada's T'Class

半腔热情 提交于 2021-01-27 07:13:41
问题 Somewhat embarassed to ask this, but I know it's for the best. I've been programming in Ada for many years now, and understand nearly every part of the language fluently. However, I've never seemed able to wrap my head around T'Class. To borrow from others, can someone "explain it like I'm five?". Edit: I bought it just to have, but contained within is a great description of, and example use of, T'Class; I refer to “Software Construction and Data Structures with Ada 95” by Michael B. Feldman.

Empty structs in C

烂漫一生 提交于 2021-01-27 06:50:49
问题 http://c0x.coding-guidelines.com/6.7.2.1.html: 1401 If the struct-declaration-list contains no named members, the behavior is undefined. Does this mean that the following is illegal? struct C { }; Or what does it mean? I used a Convention=>C Ada pointer to an empty struct (in fact empty Ada record) to serve instead void* in my bindings of a C library (because there is no void* in Ada). I wonder if this is incorrect. What do I misunderstand? See also "Do not pass or return structs with no

Empty structs in C

巧了我就是萌 提交于 2021-01-27 06:50:10
问题 http://c0x.coding-guidelines.com/6.7.2.1.html: 1401 If the struct-declaration-list contains no named members, the behavior is undefined. Does this mean that the following is illegal? struct C { }; Or what does it mean? I used a Convention=>C Ada pointer to an empty struct (in fact empty Ada record) to serve instead void* in my bindings of a C library (because there is no void* in Ada). I wonder if this is incorrect. What do I misunderstand? See also "Do not pass or return structs with no

No GNATtest in GNAT Community Edition?

房东的猫 提交于 2021-01-04 11:03:47
问题 When I try to generate unit tests in GNAT 2020 Community Edition (Windows 10 64 bit), I get an error on missing gnattest tool: could not locate gnattest . Same happens on Ubuntu 20.04 (in WSL) with package gnat-10: could not locate x86_64-linux-gnu-gnattest-10 . Is GNATtest not part of GNAT 2020 Community Edition, as shown on AdaCores website (https://www.adacore.com/gnatpro/comparison)? 回答1: Yes in 2020 Community Edition gnattest is not included. Main reason: gnattest is tool based on

No GNATtest in GNAT Community Edition?

*爱你&永不变心* 提交于 2021-01-04 11:02:47
问题 When I try to generate unit tests in GNAT 2020 Community Edition (Windows 10 64 bit), I get an error on missing gnattest tool: could not locate gnattest . Same happens on Ubuntu 20.04 (in WSL) with package gnat-10: could not locate x86_64-linux-gnu-gnattest-10 . Is GNATtest not part of GNAT 2020 Community Edition, as shown on AdaCores website (https://www.adacore.com/gnatpro/comparison)? 回答1: Yes in 2020 Community Edition gnattest is not included. Main reason: gnattest is tool based on

“Taking on a Challenge in SPARK Ada” - Sum ghost function in post-condition having unintended behavior

你离开我真会死。 提交于 2020-07-09 04:23:39
问题 I am writing a piece of software in SPARK Ada which requires the post-condition to verify that the function return value is equal to the summed values of an array. Upon proving the file where the function resides, I keep getting an error which doesn't quite add up, no pun intended (I will post screenshots of the code so as to allow a better look). The only acceptable values allowed in the array of size 10 are 0s or 1s. 回答1: In the example below (and opposed to the other answer), I separated

Drawing Bowling Pins (pyramid) with Recursion in Ada

≡放荡痞女 提交于 2020-06-27 18:37:06
问题 I know this is pushing the good will of the community by presenting my least elaborate work expecting someone to come and save me but I simply have no choice with nothing to lose. I've gone through packets, files, types, flags and boxes the last few weeks but I haven't covered much of recursion. Especially not drawing with recursion. My exam is in roughly one week and I hope this is ample time to repeat and learn simple recursion tricks like that of drawing bowling pins or other patterns: I I

Drawing a flag with diagonal crosses in a V-Shape (ADA)

和自甴很熟 提交于 2020-06-17 00:07:16
问题 I turn to Stackoverflow yet again. having gotten help here previously I hope to be received equally friendly once more. I have an assignment where I need to draw a flag (including a box-like shape around it and a V-shape of crosses in its midst) in ADA. Ive managed to make the box and roughly half of the crosses. can anyone clue me in as to how one easiest fills in the remainder of the crosses? Its supposed to be a V-shape, like this: + + + + + etc with Ada.Text_IO; use Ada.Text_IO; with Ada