|
FISH READY REFERENCE | |||||||||
|
TypesFISh data types t represent storeable values. They split into array types and shape types. The array types a are generated by datum types d
and array type variables X, and closed under the formation of array types
Each datum type has an analogous static datum type
whose values are to be computed during compilation (cost was formerly known as stat float). The given names reflect some of their properties or use, but they can be used for any static computaiton. Sizes are used to represent array lengths. Costs will be used for static cost analysis. Facts are booleans whose value never changes. Marks are fixed characters (one's mark, or signature, never changes). Shape types are either static datum types or are shapes of array types, obtained by pre-pending a # to an array type.
Take care not to confuse ~int = size with #int. The latter is the type of shapes of integers, of which there is only one correct value, which can be thought of as the memory requirements for storing one integer. Meaningful program fragments have associated phrase types th (the usual symbol is theta, but we are sticking to ascii characters here). Their structure is given by
V is a phrase type variable, whose shape is #V. Each data type t has a corresponding type exp t of expressions. Array data types (unlike shape types) are assignable, and so have a type var a to represent the variable being assigned to. comm is the type of commands. Functions are represented by function types th1 -> th2. Note that procedures (and higher-order procedures) can be expressed using function types. We often write t instead of exp t when it is clear that a phrase type is required. Each phrase type has an asociated shape. See the paper for details. FISh supports Hindley-Milner style polymorphism with respect to both array and phrase variables. That is, type schemes are obtained by quantifying types by either array or phrase type variables.
|
|||||||||
|
Page Last Updated: Friday, 07-Aug-1998 21:33:18 EST
|
![]()
Main |
Announcement |
Latest Paper |
Distribution |
Tutorial Please feel free to send any comments.
Copyright Barry Jay © 1998
|