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. Eker;Jörn W. Janneck
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