CAL language report: Specification of the CAL actor language

CAL language report: Specification of the CAL actor language
复制标题

CAL 语言报告:CAL 参与者语言规范

DOI:
--
复制
发表时间:
2003
期刊:
影响因子:
--
通讯作者:
Jörn W. Janneck
Jörn W. Janneck
中科院分区:
--
文献类型:
--
作者:
J. Eker;Jörn W. Janneck

文献摘要

被引文献

相似文献

Ly,索引是对特定函数的调用,即给定数据类型的索引器。结果表达式的类型可以取决于索引的数量和类型,当然也取决于被索引的对象。4.5可变对象及其类型一些结构化类型允许修改或改变对象,即在对象内部的某个位置改变对象。这样的类型称为可变类型,该类型的对象也称为可变类型。不加任何限制地变异对象将是一种技术,它将使程序在一般情况下基本上无法分析。出于这个原因,CAL对使用此功能的能力施加了许多限制,这将在7.1.2和7.1.3节的可变变量上下文中讨论。但是,CAL不能保证对象的各个位置是独立的正交位置,即所有其他位置保持不受分配的影响。位置独立的结构化可变类型称为自由,其自由类型位置称为正交--如果CAL中的所有预定义类型支持突变,则它们都是这种类型。例3.常见的非正交类型可能是复数类型,即复数类型。让我们假设它的对象是可变的,并且每个对象都有四个位置,表示为字段:实数、图像、模数和自变量。如果c是包含复数的可变变量,则c.Real:=4;c.imag:=3;将同时导致模分量被设置为5,并且自变量被设置为arctan 4/3。现在赋值c.arument:=2;可以被解释为保持模数不变,并相应地修改实数和图像字段,即。分别为5cos 2和5sin 2。《26数据类型4.6类型框架报告》
ly, indexing is the invocation of a special function, the indexer of a given datatype. The type of the resulting expression may depend on the number and types of the indices, and of course also on the indexed object. 4.5 Mutable objects and their types Some structured types allow the modification or mutation of an object, i.e. changing the object at some location inside it. Such a type is called mutable, and so is an object of that type. Mutating objects without any restrictions would be a technique that would render a program essentially unanalyzable in the general case. For this reason, CAL imposes a number of constraints on the ability to use this feature, which will be discussed in the context of mutable variables in sections 7.1.2 and 7.1.3. However, CAL makes no guarantee that the various locations of an object are orthogonal locations independent, i.e. that all other locations remain unaffected by an assignment. A structured mutable type whose locations are independent is called free, its free types locations are called orthogonal—all predefined types in CAL are of this kind if they support mutation. Example 3. A common non-orthogonal type might be Complex , the type of complex numbers. Let us assume its objects are mutable, and each has four locations, represented as fields: real , imag , modulus , and argument . If c is a mutable variable containing a complex number, then c.real := 4; c.imag := 3; would at the same time result in the modulus component to be set to 5, and the argument to be set to arctan 4/3. Now the assignment c.argument := 2; can be interpreted as leaving the modulus unchanged, and modifying the real and imag fields accordingly, viz. to 5 cos 2 and 5 sin 2, respectively. Eker, Janneck CAL Language Report 26 DATA TYPES 4.6 Type framework