虎是什么命| hummel是什么牌子| hpv感染吃什么药| 冰箱发烫是什么原因| 血液凝固快是什么原因| 五月份是什么星座| 什么是飞机杯| 黑头发有什么好处脑筋急转弯| 去新加坡买什么| 什么河没有水| 字什么意思| kitchen什么意思| 什么饭不能吃| 为什么腋窝老是出汗| 法令纹是什么| 澜字五行属什么| 伯伯的儿子叫什么| 势利眼的人有什么特征| 三餐两点什么意思| 喝酒伤什么器官| 辅酶q10有什么作用| 胸腔积液叩诊什么音| 怀孕肚子疼是什么原因| 离婚需要带什么证件| 可可尼女装什么档次| 梦到下雪是什么征兆| 艾拉是什么药| 什么叫慢性萎缩性胃炎| 娃娃脸适合什么发型| 取保候审是什么意思还会判刑吗| 吃红枣有什么好处和坏处| n表示什么| 香槟是什么| 海带不能和什么一起吃| 山东登州府现在叫什么| 拉钩为什么要上吊| 人为什么要穿衣服| ts代表什么| 西字里面加一横是什么字| 刚需房是什么意思| 孕妇口腔溃疡能用什么药| 肾的主要功能是什么| up主是什么意思| 喉咙疼痛一咽口水就疼吃什么药| 幽门螺杆菌吃什么药最好| 长期做梦是什么原因| 腰椎间盘突出适合什么运动| 冬天吃什么水果| 精力旺盛是什么意思| 17592a是什么尺码男装| 吃饭的时候恶心想吐是什么原因| 障碍是什么意思| 腰椎生理曲度变直是什么意思| 盆腔炎是什么原因引起的| 手脚抽筋是什么原因| 什么叫多囊| 麻蛇是什么蛇| 腿凉是什么原因引起的| 东北有什么好玩的景点| 梦见网鱼是什么征兆| 武汉属于什么地区| 汗疱疹是什么原因引起| 口腹蜜剑什么意思| 海参什么样的好| 吃什么对皮肤好还能美白的| 牛男和什么属相最配| 朋友是什么| 肾囊肿有什么症状表现| 加油站为什么不能打电话| 春什么秋什么| 黄茶适合什么人喝| 墨镜什么牌子好| 9月1号什么星座| 伏羲女娲是什么关系| 疯狂动物城闪电是什么动物| 艾条什么牌子好用| 麦粒肿是什么原因引起的| 头不由自主的轻微晃动是什么病| 唐筛和无创有什么区别| 什么是恶露| 补血吃什么药最快最好| 中耳炎吃什么药最有效| 5月4日什么星座| 宫颈欠光滑是什么意思| 动漫是什么意思| 吃什么降血压的食物| 喉咙发炎吃什么药| 3.1号是什么星座| 92年的属什么| 肝风内动是什么意思| 穆萨是什么意思| young是什么意思| 副镇长是什么级别| 晚上兼职可以做什么| 阴虚火旺吃什么中药| 七月半吃什么| 洋葱有什么好处| 鹅蛋不能和什么一起吃| 碎片是什么意思| 33朵玫瑰花代表什么意思| 什么什么生机| 辛属什么五行| 无法无天是什么生肖| 为什么印度叫阿三| 天牛喜欢吃什么| 降压药什么时间吃最好| 世界上最可怕的动物是什么| 宫颈炎有什么症状表现| josiny是什么牌子| 椰子煲汤放什么材料| 槐花什么时候开花| 什么时候可以查高考成绩| 低血压是什么原因造成的| 不知所云是什么意思| 白骨精是什么妖怪| 儿童淋巴结肿大挂什么科| 蝙蝠是什么类| 本科是什么意思| 职业暴露是什么意思| 主动脉增宽是什么意思| 晚上睡觉容易醒是什么原因| 什么是血脂| 肺结节吃什么药最好| 秋葵不能和什么一起吃| 北极贝长什么样| 农历正月十五吃什么| 颈椎压迫神经吃什么药| 吃善存片有什么好处| 脚背痛什么原因引起的| 鹿晗是什么星座| 抽血能查出什么| 宝石蓝配什么颜色好看| 夏季有什么蔬菜| 什么原因不来月经| 喝莓茶有什么好处| 生蒜头吃了有什么好处和坏处| 老火汤是什么意思| 什么样的人不容易怀孕| 尾盘放量拉升意味着什么| 推油是什么意思| 血沉是查什么病的| 最毒妇人心是什么意思| 检测怀孕最准确的方法是什么| 眼睛流水是什么原因| nc是什么意思| 权衡利弊的意思是什么| 翻什么覆什么| 梦见菊花是什么意思啊| 外向孤独症是什么意思| 床上用品四件套都有什么| 省委委员是什么级别| 数值是什么意思| 酱牛肉放什么调料| 梦见自己换衣服是什么意思| 古代宫刑是什么| 天津有什么玩的| 紫字五行属什么| 元五行属性是什么| 三伏天要注意什么| 16岁是什么年华| 小孩热感冒吃什么药好| 高职是什么学历| 淡紫色配什么颜色好看| 铁罗汉是什么茶| 结核有什么症状| 拉红尿是什么原因| 霉菌性阴道炎用什么药效果好| 卧蚕和眼袋有什么区别| 西洋参不适合什么人吃| 为什么北京是首都| 民警是干什么的| 宫崎骏是什么意思| 九月什么花开| 出车前检查的目的是什么| 座驾是什么意思| 匹夫是什么意思| 外阴灼热用什么药| 落地生根是什么生肖| 胃胀气吃什么药| 无利不起早是什么意思| 月忌日是什么意思| ab型血可以给什么血型输血| 睡美人最怕得什么病| 桃胶什么时候采摘最好| 什么是中产阶级| 脚后跟疼挂什么科| 眼睛下面有痣代表什么| 血压高是什么原因| 自主能力是什么意思| 儿童节送老婆什么礼物| 胰腺炎是什么| 为什么肚子总是胀胀的| 子宫脱落是什么原因引起的| 为什么老是恶心想吐| 殆什么意思| 44岁月经量少是什么原因| 护照办理需要什么材料| 哮喘是什么原因引起的| 喝酒眼睛红是什么原因| 肝肾衰竭有什么症状| 小猫不能吃什么| 刮痧用的油是什么油| 手足口病有什么症状| 儿童肠炎吃什么药| 多动症是什么原因造成的| 省油的灯是什么意思| 月德是什么意思| 梦见蘑菇是什么预兆| bf什么意思| 11月14号什么星座| 1969年是什么年| 吃什么不长白头发| 三是什么意思| 闭角型青光眼是什么意思| 永加日念什么| 胃火旺吃什么药| 封闭抗体是什么意思| 晚上睡觉容易醒是什么原因| 百福图挂在家里什么位置好| 心室早复极是什么意思| 弯弯的什么| 阴道炎是什么原因引起的| 6月6是什么节日| 利郎男装是什么档次的| 小腿肚子抽筋是什么原因| 腰果不能和什么一起吃| 福布斯是什么意思| 三维和四维有什么区别| ibm是什么| 阿sir什么意思| 身份证x代表什么意思| 梦见栽花是什么意思| 前列腺炎吃什么药效果好见效快| 字母哥什么位置| 祛痣挂什么科| 菁字五行属什么| 西洋参可以和什么一起泡水喝| 什么是滑脉| 不完全骨折是什么意思| 姜枣茶什么时间喝最好| 左腰疼是什么原因| 什么动物牙齿最多| 疖肿是什么意思| 女孩和女人有什么区别| 抬举征阳性是什么意思| 五子登科是什么意思| 三生三世是什么意思| 悬钟为什么叫绝骨| 欣喜若狂是什么意思| 血管属于什么组织| 警察在古代叫什么| 雾里看花是什么意思| 鸡血藤手镯有什么功效| 大伽是什么意思| 水钻是什么材质| 下呼吸道感染吃什么药| 解酒喝什么好| 9点到11点是什么经络| 头发少是什么原因| 字什么意思| 搓是什么意思| rhd阳性是什么意思| 塞上是什么意思| 脾胃不好吃什么调理| 百度Jump to content

iOS10.3.1正式版怎么样?苹果iOS10.3.1要怎么降

From Wikipedia, the free encyclopedia
Ada
Green logo on horizon with Ada letters and slogan
ParadigmMulti-paradigm: structured, imperative, object-oriented, aspect-oriented,[1] concurrent, array, distributed, generic, procedural, meta
FamilyPascal
Designed by
  • MIL-STD-1815, Ada 83: Jean Ichbiah
  • Ada 95: Tucker Taft
  • Ada 2005: Tucker Taft
  • Ada 2012: Tucker Taft
First appearedFebruary 1980; 45 years ago (1980-02)
Stable release
Ada 2022 / May 2023
Typing disciplinestatic, strong, safe, nominal
OSMulti- or cross-platform
Filename extensions.adb, .ads
Websiteadaic.org
Major implementations
AdaCore GNAT,[2]
Green Hills Software Optimising Ada 95 compiler,
PTC ApexAda and ObjectAda,[3]
MapuSoft Ada-C/C++ changer,[4] formerly known as "AdaMagic with C Intermediate",[5]
DDC-I Score
Dialects
SPARK, Ravenscar profile
Influenced by
ALGOL 68, Pascal, Simula 67,[6] C++ (Ada 95), Smalltalk (Ada 95), Modula-2 (Ada 95) Java (Ada 2005), Eiffel (Ada 2012)
Influenced
C++, Chapel,[7] Drago,[8] D, Eiffel, Griffin,[9] Java, Nim, ParaSail, PL/SQL, PL/pgSQL, Python, Ruby, Seed7, SPARforte,[10] Sparkel, SQL/PSM, VHDL
Ada mascot with slogan
百度 同时宣布启动重庆移动5G规模组网建设及应用示范工程,重庆地区最大的窄带物联网正式商用。

Ada is a structured, statically typed, imperative, and object-oriented high-level programming language, inspired by Pascal and other languages. It has built-in language support for design by contract (DbC), extremely strong typing, explicit concurrency, tasks, synchronous message passing, protected objects, and non-determinism. Ada improves code safety and maintainability by using the compiler to find errors in favor of runtime errors. Ada is an international technical standard, jointly defined by the International Organization for Standardization (ISO), and the International Electrotechnical Commission (IEC). As of May 2023, the standard, ISO/IEC 8652:2023, is called Ada 2022 informally.[11]

Ada was originally designed by a team led by French computer scientist Jean Ichbiah of Honeywell under contract to the United States Department of Defense (DoD) from 1977 to 1983 to supersede over 450 programming languages then used by the DoD.[12] Ada was named after Ada Lovelace (1815–1852), who has been credited as the first computer programmer.[13]

Features

[edit]

Ada was originally designed for embedded and real-time systems. The Ada 95 revision, designed by S. Tucker Taft of Intermetrics between 1992 and 1995, improved support for systems, numerical, financial, and object-oriented programming (OOP).

Features of Ada include: strong typing, modular programming mechanisms (packages), run-time checking, parallel processing (tasks, synchronous message passing, protected objects, and nondeterministic select statements), exception handling, and generics. Ada 95 added support for object-oriented programming, including dynamic dispatch.

The syntax of Ada minimizes choices of ways to perform basic operations, and prefers English keywords (such as or else and and then) to symbols (such as || and &&). Ada uses the basic arithmetical operators +, -, *, and /, but avoids using other symbols. Code blocks are delimited by words such as 'declare', 'begin', and 'end', where the 'end' (in most cases) is followed by the keyword of the block that it closes (e.g., if ... end if, loop ... end loop). In the case of conditional blocks this avoids a dangling else that could pair with the wrong nested 'if'-expression in other languages such as C or Java.

Ada is designed for developing very large software systems. Ada packages can be compiled separately. Ada package specifications (the package interface) can also be compiled separately without the implementation to check for consistency. This makes it possible to detect problems early during the design phase, before implementation starts.

A large number of compile-time checks are supported to help avoid bugs that would not be detectable until run-time in some other languages or would require explicit checks to be added to the source code. For example, the syntax requires explicitly named closing of blocks to prevent errors due to mismatched end tokens. The adherence to strong typing allows detecting many common software errors (wrong parameters, range violations, invalid references, mismatched types, etc.) either during compile-time, or otherwise during run-time. As concurrency is part of the language specification, the compiler can in some cases detect potential deadlocks.[14] Compilers also commonly check for misspelled identifiers, visibility of packages, redundant declarations, etc. and can provide warnings and useful suggestions on how to fix the error.

Ada also supports run-time checks to protect against access to unallocated memory, buffer overflow errors, range violations, off-by-one errors, array access errors, and other detectable bugs. These checks can be disabled in the interest of runtime efficiency, but can often be compiled efficiently. It also includes facilities to help program verification. For these reasons, Ada is sometimes used in critical systems, where any anomaly might lead to very serious consequences, e.g., accidental death, injury or severe financial loss. Examples of systems where Ada is used include avionics, air traffic control, railways, banking, military and space technology.[15][16]

Ada's dynamic memory management is high-level and type-safe. Ada has no generic or untyped pointers; nor does it implicitly declare any pointer type. Instead, all dynamic memory allocation and deallocation must occur via explicitly declared access types. Each access type has an associated storage pool that handles the low-level details of memory management; the programmer can either use the default storage pool or define new ones (this is particularly relevant for Non-Uniform Memory Access). It is even possible to declare several different access types that all designate the same type but use different storage pools. Also, the language provides for accessibility checks, both at compile time and at run time, that ensures that an access value cannot outlive the type of the object it points to.[17]

Though the semantics of the language allow automatic garbage collection of inaccessible objects, most implementations do not support it by default, as it would cause unpredictable behaviour in real-time systems. Ada supports a limited form of region-based memory management, and in Ada, destroying a storage pool also destroys all the objects in the pool.

A double-dash (--), resembling an em dash, denotes comment text. Comments stop at end of line; there is intentionally no way to make a comment span multiple lines, to prevent unclosed comments from accidentally voiding whole sections of source code. Disabling a whole block of code therefore requires the prefixing of each line (or column) individually with --. While this clearly denotes disabled code by creating a column of repeated '--' down the page, it also renders the experimental dis/re-enablement of large blocks a more drawn-out process in editors without block commenting support.

The semicolon (;) is a statement terminator, and the null or no-operation statement is null;. A single ; without a statement to terminate is not allowed.

Unlike most ISO standards, the Ada language definition (known as the Ada Reference Manual or ARM, or sometimes the Language Reference Manual or LRM) is free content. Thus, it is a common reference for Ada programmers, not only programmers implementing Ada compilers. Apart from the reference manual, there is also an extensive rationale document which explains the language design and the use of various language constructs. This document is also widely used by programmers. When the language was revised, a new rationale document was written.

One notable free software tool that is used by many Ada programmers to aid them in writing Ada source code is the GNAT Programming Studio, and GNAT which is part of the GNU Compiler Collection.

Alire is a package and toolchain management tool for Ada.[18]

History

[edit]

In the 1970s the US Department of Defense (DoD) became concerned by the number of different programming languages being used for its embedded computer system projects, many of which were obsolete or hardware-dependent, and none of which supported safe modular programming. In 1975, a working group, the High Order Language Working Group (HOLWG), was formed with the intent to reduce this number by finding or creating a programming language generally suitable for the department's and the UK Ministry of Defence's requirements. After many iterations beginning with an original straw-man proposal[19] the eventual programming language was named Ada. The total number of high-level programming languages in use for such projects fell from over 450 in 1983 to 37 by 1996.

HOLWG crafted the Steelman language requirements , a series of documents stating the requirements they felt a programming language should satisfy. Many existing languages were formally reviewed, but the team concluded in 1977 that no existing language met the specifications. The requirements were created by the United States Department of Defense in The Department of Defense Common High Order Language program in 1978. The predecessors of this document were called, in order, "Strawman", "Woodenman", "Tinman" and "Ironman".[20] The requirements focused on the needs of embedded computer applications, and emphasised reliability, maintainability, and efficiency. Notably, they included exception handling facilities, run-time checking, and parallel computing.

It was concluded that no existing language met these criteria to a sufficient extent,[21] so a contest was called to create a language that would be closer to fulfilling them. The design that won this contest became the Ada programming language. The resulting language followed the Steelman requirements closely, though not exactly.

Watercolour painting of Ada Lovelace

Requests for proposals for a new programming language were issued and four contractors were hired to develop their proposals under the names of Red (Intermetrics led by Benjamin Brosgol), Green (Honeywell, led by Jean Ichbiah), Blue (SofTech, led by John Goodenough)[22] and Yellow (SRI International, led by Jay Spitzen). In April 1978, after public scrutiny, the Red and Green proposals passed to the next phase. In May 1979, the Green proposal, designed by Jean Ichbiah at Honeywell, was chosen and given the name Ada—after Augusta Ada King, Countess of Lovelace, usually known as Ada Lovelace. This proposal was influenced by the language LIS that Ichbiah and his group had developed in the 1970s. The preliminary Ada reference manual was published in ACM SIGPLAN Notices in June 1979. The Military Standard reference manual was approved on December 10, 1980 (Ada Lovelace's birthday), and given the number MIL-STD-1815 in honor of Ada Lovelace's birth year. In 1981, Tony Hoare took advantage of his Turing Award speech to criticize Ada for being overly complex and hence unreliable,[23] but subsequently seemed to recant in the foreword he wrote for an Ada textbook.[24]

Ada attracted much attention from the programming community as a whole during its early days. Its backers and others predicted that it might become a dominant language for general purpose programming and not only defense-related work.[25] Ichbiah publicly stated that within ten years, only two programming languages would remain: Ada and Lisp.[26] Early Ada compilers struggled to implement the large, complex language, and both compile-time and run-time performance tended to be slow and tools primitive.[25] Compiler vendors expended most of their efforts in passing the massive, language-conformance-testing, government-required Ada Compiler Validation Capability (ACVC) validation suite that was required in another novel feature of the Ada language effort.[26]

The first validated Ada implementation was the NYU Ada/Ed translator,[27] certified on April 11, 1983. NYU Ada/Ed is implemented in the high-level set language SETL.[28] Several commercial companies began offering Ada compilers and associated development tools, including Alsys, TeleSoft, DDC-I, Advanced Computer Techniques, Tartan Laboratories, Irvine Compiler, TLD Systems, and Verdix.[29] Computer manufacturers who had a significant business in the defense, aerospace, or related industries, also offered Ada compilers and tools on their platforms; these included Concurrent Computer Corporation, Cray Research, Inc., Digital Equipment Corporation, Harris Computer Systems, and Siemens Nixdorf Informationssysteme AG.[29]

In 1991, the US Department of Defense began to require the use of Ada (the Ada mandate) for all software,[30] though exceptions to this rule were often granted.[25] The Department of Defense Ada mandate was effectively removed in 1997, as the DoD began to embrace commercial off-the-shelf (COTS) technology.[25] Similar requirements existed in other NATO countries: Ada was required for NATO systems involving command and control and other functions, and Ada was the mandated or preferred language for defense-related applications in countries such as Sweden, Germany, and Canada.[31]

By the late 1980s and early 1990s, Ada compilers had improved in performance, but there were still barriers to fully exploiting Ada's abilities, including a tasking model that was different from what most real-time programmers were used to.[26]

Because of Ada's safety-critical support features, it is now used not only for military applications, but also in commercial projects where a software bug can have severe consequences, e.g., avionics and air traffic control, commercial rockets such as the Ariane 4 and 5, satellites and other space systems, railway transport and banking.[16] For example, the Primary Flight Control System, the fly-by-wire system software in the Boeing 777, was written in Ada, as were the fly-by-wire systems for the aerodynamically unstable Eurofighter Typhoon,[32] Saab Gripen,[33] Lockheed Martin F-22 Raptor and the DFCS replacement flight control system for the Grumman F-14 Tomcat. The Canadian Automated Air Traffic System was written in 1 million lines of Ada (SLOC count). It featured advanced distributed processing, a distributed Ada database, and object-oriented design. Ada is also used in other air traffic systems, e.g., the UK's next-generation Interim Future Area Control Tools Support (iFACTS) air traffic control system is designed and implemented using SPARK Ada.[34] It is also used in the French TVM in-cab signalling system on the TGV high-speed rail system, and the metro suburban trains in Paris, London, Hong Kong and New York City.[16][35]

The Ada 95 revision of the language went beyond the Steelman requirements, targeting general-purpose systems in addition to embedded ones, and adding features supporting object-oriented programming.[36]

Standardization

[edit]
Timeline of Ada language
Year Informal name Official Standard
1980 Ada ANSI MIL-STD 1815
1983 Ada 83/87 ANSI MIL-STD 1815A
ISO/IEC 8652:1987
1995 Ada 95 ISO/IEC 8652:1995
2007 Ada 2005 ISO/IEC 8652:1995/Amd 1:2007
2012 Ada 2012 ISO/IEC 8652:2012
2023 Ada 2022 ISO/IEC 8652:2023

Preliminary Ada can be found in ACM Sigplan Notices Vol 14, No 6, June 1979[37]

Ada was first published in 1980 as an ANSI standard ANSI/MIL-STD 1815. As this very first version held many errors and inconsistencies, [a] the revised edition was published in 1983 as ANSI/MIL-STD 1815A. Without any further changes, it became an ISO standard in 1987.[39] This version of the language is commonly known as Ada 83, from the date of its adoption by ANSI, but is sometimes referred to also as Ada 87, from the date of its adoption by ISO.[40] There is also a French translation; DIN translated it into German as DIN 66268 in 1988.

Ada 95, the joint ISO/IEC/ANSI standard ISO/IEC 8652:1995[41][42] was published in February 1995, making it the first ISO standard object-oriented programming language. To help with the standard revision and future acceptance, the US Air Force funded the development of the GNAT Compiler. Presently, the GNAT Compiler is part of the GNU Compiler Collection.

Work has continued on improving and updating the technical content of the Ada language. A Technical Corrigendum to Ada 95 was published in October 2001,[43][44] and a major Amendment, ISO/IEC 8652:1995/Amd 1:2007 [45][46] was published on March 9, 2007, commonly known as Ada 2005 because work on the new standard was finished that year.

At the Ada-Europe 2012 conference in Stockholm, the Ada Resource Association (ARA) and Ada-Europe announced the completion of the design of the latest version of the Ada language and the submission of the reference manual to the ISO/IEC JTC 1/SC 22/WG 9 of the International Organization for Standardization (ISO) and the International Electrotechnical Commission (IEC) for approval. ISO/IEC 8652:2012[47](see Ada 2012 RM) was published in December 2012, known as Ada 2012. A technical corrigendum, ISO/IEC 8652:2012/COR 1:2016, was published [48](see RM 2012 with TC 1).

On May 2, 2023, the Ada community saw the formal approval of publication of the Ada 2022 edition of the programming language standard.[11]

Despite the names Ada 83, 95 etc., legally there is only one Ada standard, the last ISO/IEC standard: with the acceptance of a new standard version, the previous one becomes withdrawn. The other names are just informal ones referencing a certain edition.

Other related standards include ISO/IEC 8651-3:1988 Information processing systems—Computer graphics—Graphical Kernel System (GKS) language bindings—Part 3: Ada.

Language constructs

[edit]

Ada is an ALGOL-like programming language featuring control structures with reserved words such as if, then, else, while, for, and so on. However, Ada also has many data structuring facilities and other abstractions which were not included in the original ALGOL 60, such as type definitions, records, pointers, enumerations. Such constructs were in part inherited from or inspired by Pascal.

"Hello, world!" in Ada

[edit]

A common example of a language's syntax is the "Hello, World!" program: (hello.adb)

with Ada.Text_IO;
procedure Hello is
begin
   Ada.Text_IO.Put_Line ("Hello, world!");
end Hello;

This program can be compiled by using the freely available open source compiler GNAT, by executing

gnatmake hello.adb

Data types

[edit]

Ada's type system is not based on a set of predefined primitive types but allows users to declare their own types. This declaration in turn is not based on the internal representation of the type but on describing the goal which should be achieved. This allows the compiler to determine a suitable memory size for the type, and to check for violations of the type definition at compile time and run time (i.e., range violations, buffer overruns, type consistency, etc.). Ada supports numerical types defined by a range, modulo types, aggregate types (records and arrays), and enumeration types. Access types define a reference to an instance of a specified type; untyped pointers are not permitted. Special types provided by the language are task types and protected types.

For example, a date might be represented as:

type Day_type   is range    1 ..   31;
type Month_type is range    1 ..   12;
type Year_type  is range 1800 .. 2100;
type Hours is mod 24;
type Weekday is (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday);

type Date is
   record
     Day   : Day_type;
     Month : Month_type;
     Year  : Year_type;
   end record;

Important to note: Day_type, Month_type, Year_type, Hours are incompatible types, meaning that for instance the following expression is illegal:

Today: Day_type := 4;
Current_Month: Month_type := 10;
... Today + Current_Month ...  -- illegal

The predefined plus-operator can only add values of the same type, so the expression is illegal.

Types can be refined by declaring subtypes:

subtype Working_Hours is Hours range 0 .. 12;            -- at most 12 Hours to work a day
subtype Working_Day is Weekday range Monday .. Friday;   -- Days to work

Work_Load: constant array(Working_Day) of Working_Hours  -- implicit type declaration
   := (Friday => 6, Monday => 4, others => 10);           -- lookup table for working hours with initialization

Types can have modifiers such as limited, abstract, private etc. Private types do not show their inner structure; objects of limited types cannot be copied.[49] Ada 95 adds further features for object-oriented extension of types.

Control structures

[edit]

Ada is a structured programming language, meaning that the flow of control is structured into standard statements. All standard constructs and deep-level early exit are supported, so the use of the also supported "go to" commands is seldom needed.

-- while a is not equal to b, loop.
while a /= b loop
  Ada.Text_IO.Put_Line ("Waiting");
end loop;

if a > b then
  Ada.Text_IO.Put_Line ("Condition met");
else
  Ada.Text_IO.Put_Line ("Condition not met");
end if;

for i in 1 .. 10 loop
  Ada.Text_IO.Put ("Iteration: ");
  Ada.Text_IO.Put (i);
  Ada.Text_IO.Put_Line;
end loop;

loop
  a := a + 1;
  exit when a = 10;
end loop;

case i is
  when 0 => Ada.Text_IO.Put ("zero");
  when 1 => Ada.Text_IO.Put ("one");
  when 2 => Ada.Text_IO.Put ("two");
  -- case statements have to cover all possible cases:
  when others => Ada.Text_IO.Put ("none of the above");
end case;

for aWeekday in Weekday'Range loop               -- loop over an enumeration
   Put_Line ( Weekday'Image(aWeekday) );         -- output string representation of an enumeration
   if aWeekday in Working_Day then               -- check of a subtype of an enumeration
      Put_Line ( " to work for " &
               Working_Hours'Image (Work_Load(aWeekday)) ); -- access into a lookup table
   end if;
end loop;

Packages, procedures and functions

[edit]

Among the parts of an Ada program are packages, procedures and functions.

Functions differ from procedures in that they must return a value. Function calls cannot be used "as a statement", and their result must be assigned to a variable. However, since Ada 2012, functions are not required to be pure and may mutate their suitably declared parameters or the global state.[50]

Example: Package specification (example.ads)

package Example is
     type Number is range 1 .. 11;
     procedure Print_and_Increment (j: in out Number);
end Example;

Package body (example.adb)

with Ada.Text_IO;
package body Example is

  i : Number := Number'First;

  procedure Print_and_Increment (j: in out Number) is

    function Next (k: in Number) return Number is
    begin
      return k + 1;
    end Next;

  begin
    Ada.Text_IO.Put_Line ( "The total is: " & Number'Image(j) );
    j := Next (j);
  end Print_and_Increment;

-- package initialization executed when the package is elaborated
begin
  while i < Number'Last loop
    Print_and_Increment (i);
  end loop;
end Example;

This program can be compiled, e.g., by using the freely available open-source compiler GNAT, by executing

gnatmake -z example.adb

Packages, procedures and functions can nest to any depth, and each can also be the logical outermost block.

Each package, procedure or function can have its own declarations of constants, types, variables, and other procedures, functions and packages, which can be declared in any order.

Pragmas

[edit]

A pragma is a compiler directive that conveys information to the compiler to allow specific manipulating of compiled output.[51] Certain pragmas are built into the language,[52] while others are implementation-specific.

Examples of common usage of compiler pragmas would be to disable certain features, such as run-time type checking or array subscript boundary checking, or to instruct the compiler to insert object code instead of a function call (as C/C++ does with inline functions).

Generics

[edit]

Ada has had generics since it was first designed in 1977–1980. The standard library uses generics to provide many services. Ada 2005 adds a comprehensive generic container library to the standard library, which was inspired by C++'s Standard Template Library.

A generic unit is a package or a subprogram that takes one or more generic formal parameters.[53]

A generic formal parameter is a value, a variable, a constant, a type, a subprogram, or even an instance of another, designated, generic unit. For generic formal types, the syntax distinguishes between discrete, floating-point, fixed-point, access (pointer) types, etc. Some formal parameters can have default values.

To instantiate a generic unit, the programmer passes actual parameters for each formal. The generic instance then behaves just like any other unit. It is possible to instantiate generic units at run-time, for example inside a loop.

See also

[edit]
  • Ada compilers
  • ALGOL 68 – Programming language
  • APSE – Programming environment specification
  • Pascal – Programming language
  • Ravenscar profile – Feature of the Ada programming language
  • Smalltalk – Object-oriented programming language
  • SPARK – Programming language
  • VHDL – Hardware description language

Notes

[edit]
  1. ^ see Summary of Ada Language Changes[38]
  1. ^ "Ada2012 Rationale" (PDF). adacore.com. Archived (PDF) from the original on 18 April 2016. Retrieved 5 May 2018.
  2. ^ "Commercial software solutions for Ada, C and C++". AdaCore. Retrieved Apr 4, 2023.
  3. ^ "PTC ObjectAda". PTC.com. Retrieved 2025-08-05.
  4. ^ "MapuSoft Ada-C/C++ changer". 16 April 2019.
  5. ^ "Ada 95 Certified Processors List – Details". ada-auth.org. Retrieved Apr 4, 2023.
  6. ^ Ada Rationale, 1986, pp. 23, 70, 110–114, 137, 165, 236
  7. ^ "Chapel spec (Acknowledgements)" (PDF). Cray Inc. 2025-08-05. Archived (PDF) from the original on 2025-08-05. Retrieved 2025-08-05.
  8. ^ "Drago". Archived from the original on 2025-08-05. Retrieved 2025-08-05.
  9. ^ "The Griffin Project". cs.nyu.edu. Retrieved Apr 4, 2023.
  10. ^ "SparForte Programming Language". www.sparforte.com. Retrieved Apr 4, 2023.
  11. ^ a b Pinho, Luis Miguel (June 2023). "From the Editor's Desk". Ada Letters. XLIII (1). Association for Computing Machinery: 3. doi:10.1145/3631483 (inactive 1 July 2025).{{cite journal}}: CS1 maint: DOI inactive as of July 2025 (link)
  12. ^ "The Ada Programming Language". University of Mich. Archived from the original on 2025-08-05. Retrieved 27 May 2016.
  13. ^ Fuegi, J; Francis, J (2003). "Lovelace & Babbage and the creation of the 1843 'notes'". IEEE Annals of the History of Computing. 25 (4): 16–26. doi:10.1109/MAHC.2003.1253887. S2CID 40077111.
  14. ^ "Concurrency". Ada 95 Quality and Style Guide. Ada Information Clearinghouse. Retrieved November 5, 2021.
  15. ^ Taft, S. Tucker; Olsen, Florence (2025-08-05). "Ada helps churn out less-buggy code". Government Computer News. pp. 2–3. Archived from the original on 2025-08-05. Retrieved 2025-08-05.
  16. ^ a b c Feldman, Michael. "Who's Using Ada? Real-World Projects Powered by the Ada Programming Language November 2014". SIGAda Education Working Group.
  17. ^ no safe dynamic memory management in ADA, in: Writing Linux Kernel Modules in Safe Rust – Geoffrey Thomas & Alex Gaynor, The Linux Foundation, 2025-08-05
  18. ^ "Alire - Homepage". Adacore. Retrieved 2025-08-05.
  19. ^ "DoD – Strawman Requirements – April 1975". iment.com. Retrieved Apr 4, 2023.
  20. ^ Department of Defense (June 1978), Requirements for High Order Computer Programming Languages: "Steelman"
  21. ^ SoftTech Inc. (1976), "Evaluation of ALGOL 68, Jovial J3B, Pascal, Simula 67, and TACPOL Versus TINMAN - Requirements for a Common High Order Programming Language." - See also: ALGOL 68, JOVIAL J3B, Pascal, Simula 67, and TACPOL (Defense Technical Information Center - DTIC ADA037637, Report Number 1021-14)
  22. ^ "John Goodenough | SEI Staff Profile". Sei.cmu.edu. Retrieved 2025-08-05.
  23. ^ C.A.R., Hoare (1981). "The Emperor's Old Clothes" (PDF). Communications of the ACM. 24 (2). Association for Computing Machinery: 75–83. doi:10.1145/358549.358561. S2CID 97895. Archived (PDF) from the original on 2025-08-05.
  24. ^ Watt, D.A.; Wichmann, B.A.; Findlay, W. (1987). Ada: Language and Methodology. Prentice-Hall.
  25. ^ a b c d Sward, Ricky E. (November 2010). "The rise, fall and persistence of Ada". SIGAda '10: Proceedings of the ACM SIGAda annual international conference on SIGAda. pp. 71–74. doi:10.1145/1879063.1879081. ISBN 978-1-4503-0027-8.
  26. ^ a b c Rosen, J-P. (August 2009). "The Ada Paradox(es)". Ada Letters. 24 (2). ACM SIGAda: 28–35. doi:10.1145/1620593.1620597. S2CID 608405.
  27. ^ SofTech Inc. (2025-08-05). "Ada Compiler Validation Summary Report: NYU Ada/ED, Version 19.7 V-001". Waltham, MA. Archived from the original on 2025-08-05. Retrieved 2025-08-05.
  28. ^ Dewar, Robert B. K.; Fisher, Gerald A. Jr.; Schonberg, Edmond; Froelich, Robert; Bryant, Stephen; Goss, Clinton F.; Burke, Michael (November 1980). "The NYU Ada translator and interpreter". Proceeding of the ACM-SIGPLAN symposium on Ada programming language – SIGPLAN '80. Vol. 15. pp. 194–201. doi:10.1145/948632.948659. ISBN 0-89791-030-3. S2CID 10586359.
  29. ^ a b "Ada Validated Compilers List". Ada Information Clearinghouse. July 1, 1992. pp. 1–36.
  30. ^ Ada Information Clearinghouse (1994). "The Congressional Ada Mandate". Archived from the original on 2025-08-05. Retrieved 2025-08-05.
  31. ^ Babiak, Nicholas J. (1989). Ada, the New DoD Weapon System Computer Language – Panacea or Calamity (PDF). Air University (United States Air Force). pp. 39–40. Archived (PDF) from the original on December 15, 2019.
  32. ^ "Agile thinking". FlightGlobal. 16 June 1999. Archived from the original on 15 April 2021. Retrieved 13 Feb 2024.
  33. ^ Frisberg, Bo. "Usage of Ada in the Gripen Flight Control System" (PDF). The Special Interest Group on Ada. Archived (PDF) from the original on 15 Jan 2024. Retrieved 13 Feb 2024.
  34. ^ AdaCore. "GNAT Pro Chosen for UK's Next Generation ATC System". Archived from the original on 2025-08-05. Retrieved 2025-08-05.
  35. ^ AdaCore. "Look Who's Using Ada". Archived from the original on 2025-08-05. Retrieved 2025-08-05.
  36. ^ David A. Wheeler (1997), "Ada, C, C++, and Java vs. The Steelman". Originally published in Ada Letters July/August 1997
  37. ^ Ichbiah, J. D. (June 1979). "ACM Sigplan Notices". pp. 1–145. doi:10.1145/956650.956651.
  38. ^ Summary of Ada Language Changes
  39. ^ "ISO 8652:1987". ISO. 2025-08-05. Retrieved 2025-08-05.
  40. ^ "Ada 83 LRM, Front Page". archive.adaic.com. Retrieved 2025-08-05.
  41. ^ "ISO/IEC 8652:1995". ISO. Retrieved 2025-08-05.
  42. ^ "Ada 95 Language Reference Manual (original) – Ada Resource Association". www.adaic.org. Retrieved 2025-08-05.
  43. ^ ISO/IEC 8652:1995/Corr 1:2001
  44. ^ Ada 95 RM with TC 1
  45. ^ "ISO/IEC 8652:1995/Amd 1:2007". ISO. Retrieved 2025-08-05.
  46. ^ "Ada Reference Manual, ISO/IEC 8652:2007(E) Ed. 3". www.adaic.org. Retrieved 2025-08-05.
  47. ^ "ISO/IEC 8652:2012". ISO. 2025-08-05. Retrieved 2025-08-05.
  48. ^ "ISO/IEC 8652:2012/Cor 1:2016". ISO. Retrieved 2025-08-05.
  49. ^ "Ada Syntax Card" (PDF). Archived from the original (PDF) on 6 July 2011. Retrieved 28 February 2011.
  50. ^ "Subprograms". learn.adacore.com. AdaCore. Retrieved 14 April 2024.
  51. ^ "Ada 83 LRM, Sec 2.8: Pragmas". Archive.adaic.com. Retrieved 2025-08-05.
  52. ^ "Ada 83 LRM, Appendix/Annex B: Predefined Language Pragmas". Archive.adaic.com. Archived from the original on 2025-08-05. Retrieved 2025-08-05.
  53. ^ "Generic Units". www.adaic.org. Retrieved 2025-08-05.

References

[edit]

International standards

[edit]

Rationale

[edit]

These documents have been published in various forms, including print.

Books

[edit]
  • Booch, Grady (1987). Software Engineering with Ada. California: The Benjamin/Cummings Publishing Company. ISBN 0-8053-0604-8.
  • Skansholm, Jan (1996). Ada 95 From the Beginning. Addison-Wesley. ISBN 0-201-40376-5.
  • Gilpin, Geoff (1985). Ada: A Guided Tour and Tutorial. Prentice hall. ISBN 978-0-13-004045-9.
  • Beidler, John (1997). Data Structures and Algorithms: An Object-Oriented Approach Using Ada 95. Springer-Verlag. ISBN 0-387-94834-1.
  • Gonzalez, Dean W. (1991). Ada Programmer's Handbook. Benjamin-Cummings Publishing Company. ISBN 0-8053-2529-8.
  • Ben-Ari, M. (1998). Ada for Software Engineers. John Wiley & Sons. ISBN 0-471-97912-0.
  • Cohen, Norman (1996). Ada as a Second Language. McGraw-Hill Science/Engineering/Math. ISBN 0-07-011607-5.
  • Burns, Alan; Wellings, Andy (2001). Real-Time Systems and Programming Languages. Ada 95, Real-Time Java and Real-Time POSIX. Addison-Wesley. ISBN 0-201-72988-1.
  • Burns, Alan; Wellings, Andy (1995). Concurrency in Ada. Cambridge University Press. ISBN 0-521-62911-X.
  • Atkinson, Colin (1991). Object-Oriented Reuse, Concurrency and Distribution: An Ada-Based Approach. Addison-Wesley. ISBN 0-201-56527-7.
  • Booch, Grady; Bryan, Doug (1994). Software Engineering with Ada. Addison-Wesley. ISBN 0-8053-0608-0.
  • Jones, Do-While (1989). Ada in Action: With Practical Programming Examples. John Wiley & Sons. ISBN 0-471-60708-8.
  • Stubbs, Daniel; Webre, Neil W. (1993). Data Structures with Abstract Data Types and Ada. Brooks Cole. ISBN 0-534-14448-9.
  • Ledru, Pascal (December 1998). Distributed Programming in Ada with Protected Objects. Dissertation.com. ISBN 1-58112-034-6.
  • Culwin, Fintan (1997). Ada, a Developmental Approach. Prentice Hall. ISBN 0-13-264680-3.
  • English, John; Culwin, Fintan (January 1997). Ada 95 the Craft of Object-Oriented Programming. Prentice Hall. ISBN 0-13-230350-7.
  • Musser, David R.; Stepanov, Alexander (24 October 1989). The Ada Generic Library: Linear List Processing Packages. Springer-Verlag. ISBN 0-387-97133-5.
  • Feldman, Michael B. (1997). Software Construction and Data Structures with Ada 95. Addison-Wesley. ISBN 0-201-88795-9.
  • Johnston, Simon (1997). Ada 95 for C and C++ Programmers. Addison-Wesley. ISBN 0-201-40363-3.
  • Feldman, Michael B.; Koffman, Elliot B. (1992–1993). Ada: Problem Solving and Program Design. Addison-Wesley. ISBN 0-201-52279-9. 795 pages.
  • Feldman, Michael B.; Koffman, Elliot B. (1999). Ada 95. Addison-Wesley. ISBN 0-201-36123-X.
  • Dale, Nell B.; Weems, Chip; McCormick, John (August 1996). Programming and Problem Solving with Ada 95. Jones & Bartlett Publishers. ISBN 0-7637-0293-5.
  • Dale, Nell B.; McCormick, John (2007). Ada Plus Data Structures: An Object-Oriented Approach, 2nd edition. Jones & Bartlett Publishers. ISBN 978-0-7637-3794-8.
  • Krell, Bruce C. (1992). Developing With Ada: Life-Cycle Methods. Bantam Dell Pub Group. ISBN 0-553-09102-6.
  • Bishop, Judy (10 May 1990). Distributed Ada: Developments and Experiences. Cambridge University Press. ISBN 0-521-39251-9.
  • Sanden, Bo (1994). Software Systems Construction With Examples in Ada. Prentice Hall. ISBN 0-13-030834-X.
  • Hillam, Bruce (1994). Introduction to Abstract Data Types Using Ada. Prentice Hall. ISBN 0-13-045949-6.
  • Rudd, David (1994). Introduction to Software Design and Development With Ada. Brooks Cole. ISBN 0-314-02829-3.
  • Pyle, Ian C. (1991). Developing Safety Systems: A Guide Using Ada. Prentice Hall. ISBN 0-13-204298-3.
  • Baker, Louis (1989). Artificial Intelligence With Ada. McGraw-Hill. ISBN 0-07-003350-1.
  • Burns, Alan; Wellings, Andy (1995). HRT-HOOD: A Structured Design Method for Hard Real-Time Ada Systems. North-Holland. ISBN 0-444-82164-3.
  • Savitch, Walter; Peterson, Charles (1992). Ada: An Introduction to the Art and Science of Programming. Benjamin-Cummings Publishing Company. ISBN 0-8053-7070-6.
  • Weiss, Mark Allen (1993). Data Structures and Algorithm Analysis in Ada. Benjamin-Cummings Publishing Company. ISBN 0-8053-9055-3.
  • Ledgard, Henry (1983). Ada: An Introduction (second ed.). Springer-Verlag. ISBN 0-387-90814-5.
  • Bj?rner, Dines; Oest, Ole N., eds. (1980). Towards a Formal Description of Ada. London: Springer-Verlag. ISBN 3-540-10283-3.

Further reading

[edit]
[edit]
dr是什么检查项目 麻疹的症状是什么 什么体质的人戴银变黑 有机会是什么意思 芈月传芈姝结局是什么
伏笔是什么意思 女人颧骨高有什么说法 转氨酶高吃什么药效果好 肝回声改变是什么意思 韩红什么军衔
隐血是什么意思 腹部b超能检查什么 浑身酸痛什么原因 相交是什么意思 月寸读什么
五六月份是什么星座 干咳是什么原因 医士是什么职称 BLD医学上是什么意思 声音的传播需要什么
妊娠期是指什么时候hcv9jop0ns9r.cn 六月份是什么星座hcv7jop9ns3r.cn 花木兰是什么朝代xjhesheng.com 睡眠不好是什么原因hcv9jop6ns8r.cn 虚岁是什么意思qingzhougame.com
人老珠黄是什么动物hcv9jop6ns3r.cn 五月份是什么季节hcv7jop6ns4r.cn 什么的杨桃hcv8jop3ns7r.cn 肝血不足吃什么食补最快hcv9jop0ns1r.cn haglofs是什么牌子hcv8jop7ns4r.cn
花裙子配什么上衣好看aiwuzhiyu.com pangchi是什么牌子的手表hcv9jop0ns1r.cn 心脏搭桥后最怕什么hcv8jop8ns9r.cn 燃脂是什么意思hcv8jop8ns4r.cn 什么手机电池最耐用hcv7jop9ns9r.cn
榴莲有什么作用hcv9jop7ns9r.cn 红薯和什么不能一起吃hcv9jop5ns4r.cn 樱桃不能和什么一起吃hcv7jop6ns9r.cn 颐养天年是什么意思hcv8jop9ns0r.cn 伤口发痒是什么原因hcv9jop4ns1r.cn
百度