[Swift-commit] r3910 - text/parco10submission

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Sat Jan 8 17:13:33 CST 2011


Author: wilde
Date: 2011-01-08 17:13:33 -0600 (Sat, 08 Jan 2011)
New Revision: 3910

Modified:
   text/parco10submission/paper.tex
Log:
A few more edits on the type model.

Modified: text/parco10submission/paper.tex
===================================================================
--- text/parco10submission/paper.tex	2011-01-08 23:07:11 UTC (rev 3909)
+++ text/parco10submission/paper.tex	2011-01-08 23:13:33 UTC (rev 3910)
@@ -392,26 +392,26 @@
 can be declared ``global'' to make them accessible to every other function in the script.
 
 Each variable in a Swift script is declared to be of a specific (single) type. The Swift type model is simple, with no concepts of inheritance, abstraction, etc. 
-There are three basic classes of data types: primitive, mapped, and collection. 
+There are three basic classes of data types: primitive, mapped, and collection.
 
 \emph{Primitive types} are provided for integer, float, string, and boolean values. Common operators are defined for
 primitive types, such as arithmetic, concatenation, and explicit conversion.
 An additional primitive type ``external'' is provided for manual synchronization.
 
-\emph{Mapped types} are data elements that refer (through a process called``mapping'') to files external to the Swift script. 
+\emph{Mapped types} Mapped types are provided to declare data elements that refer (through a process called``mapping'') to files external to the Swift script.
 These files can then be read and written by application programs called by Swift.
 The mapping process can map single variables to single files, and structures and arrays to collections of files.
+At the moment, there are no built-in mapped types in the language. Instead, users simply declare type names with no other structure to denote any mapped type names desired. For example: {\tt type file; type log;}
 
 \emph{Collection types} are \emph{arrays} and \emph{structures}.
-Arrays contain values of only a single type; structure fields can be of any type. One
-array type is provided for every scalar and mapped type.
+Arrays contain values of only a single type; structure fields can be of any type. Arrays can be created and defined to be of any primitive or declared type.
 Arrays use numeric indices, but are sparse.
 Both types of collections can contain members of primitive, mapped, or collection types;
 in particular, arrays can be nested to provide multi-dimensional indexing.
 Structures contain a declared number of elements. The number of elements in an array can be determined at run time. 
 
+New types can be declared to define a new mapped type or to name a structure type. The type model is by design very simple and limited to keep type semantics easy to understand, implement and use.
 
-
 Due to the dynamic, parallel nature of Swift, its arrays have no notion of size. Array elements can be set as a script's execution progresses. The number of elements set increases monotonically. An array is considered ``closed'' when no further statements that set an element of the array can be executed. This state is recognized at run time by information obtained from compile-time analysis of the script's call graph.
 %IAN: This last paragraph raises the issue of whether this state can always be determiend.
 
@@ -447,7 +447,7 @@
 The notation \verb|{}| indicates that the type represents a reference to a single \emph{opaque}
 file, i.e., a reference to an external object whose structure is opaque to the Swift script. 
 For convenience such type declarations typically use the equivalent shorthand \verb|type image;| 
-(which new users find confusing but which has become a Swift idiom).
+(this compact notation is confusing at first but has become a useful Swift idiom).
 
 Mapped type variable declarations can be specified with a
 \emph{mapping} descriptor enclosed in \verb|<>| that indicates the file to be mapped to the variable.




More information about the Swift-commit mailing list