【Ada语言学习笔记】参考手册中文翻译及注记——语言概述



我们在Concurrent & Distributed Systems课的实验中需要用到Ada语言。

通俗而笼统地讲,Ada语言是一种描述特别详尽的语言(highly specific),因此它的特点是在编译阶段和运行时能够进行大量的检查,能够更加精确地定位错误的位置和类型(因为语言本身详尽了,你提供的信息量越大,编译器能够做的就更多)。


这里是Ada的参考手册


本篇翻译手册中的语言概述(Language Summary)。

 http://blog.csdn.net/iyundi


Language Summary
11
An Ada program is composed of one or more program units. Program units may be subprograms (which define executable algorithms), packages (which define collections of entities), task units (which define concurrent computations), protected units (which define operations for the coordinated sharing of data between tasks), or generic units (which define parameterized forms of packages and subprograms). Each program unit normally consists of two parts: a specification, containing the information that must be visible to other units, and a body, containing the implementation details, which need not be visible to other units. Most program units can be compiled separately.
Ada程序由一到多个程序单元组成。程序单元可以是 子程序(定义可执行的算法)、 (定义实体的集合)、 任务单元(定义并行计算单元)、 受保护单元(定义针对任务间协作的共享数据的操作)或 泛型单元(定义参数化的包和子程序)。每个程序单元通常由两部分组成: 定义段(specification)——包含应对其他单元可见的信息,和 主体段(body)——包含实现的细节,不需被其他单元所见。大多数程序单元可以被独立地编译。
注:在实验指导里还有一句:In Ada those two aspects are separated into two separate source files which will be independently compiled. 这两部分分别位于两个独立的原文件中并将会被独立地编译。
12
This distinction of the specification and body, and the ability to compile units separately, allows a program to be designed, written, and tested as a set of largely independent software components.
定义段与实体段的分离,以及不同单元分开编译的能力,使得一个程序可以作为一组高度独立的软件组件而被设计、编写和测试。
13
An Ada program will normally make use of a library of program units of general utility. The language provides means whereby individual organizations can construct their own libraries. All libraries are structured in a hierarchical manner; this enables the logical decomposition of a subsystem into individual components. The text of a separately compiled program unit must name the library units it requires.
Ada程序通常会利用作为通用工具的程序单元库。这一语言提供了一些方法,使得不同的组织可以构建自己的库。所有的库以层次结构来组织:这样就能够将一个子系统从逻辑上分解为独立的组件。分别独立编译的程序单元文本必须指明它所需库单元的名字。
14
Program Units
程序单元
15
A subprogram is the basic unit for expressing an algorithm. There are two kinds of subprograms: procedures and functions. A procedure is the means of invoking a series of actions. For example, it may read data, update variables, or produce some output. It may have parameters, to provide a controlled means of passing information between the procedure and the point of call. A function is the means of invoking the computation of a value. It is similar to a procedure, but in addition will return a result.
子程序表达算法的基本单元。有两种子程序:过程(procedure)和函数(function)。过程就是调用一系列的动作。例如读取数据、更新变量、产生输出。它可以有形参,以一种受控的方式在调用点和过程(procedure)间传递信息。函数则是调用一个计算过程来得到一个值。它很像过程,但额外返回一个结果。
16
A package is the basic unit for defining a collection of logically related entities. For example, a package can be used to define a set of type declarations and associated operations. Portions of a package can be hidden from the user, thus allowing access only to the logical properties expre
  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值