Department of Computer Science and Technology

Technical reports

Poly manual

David C.J. Matthews

February 1985, 46 pages

Abstract

Poly is a general purpose, High-level programming language. It has a simple type system which is also very powerful. Higher order procedures, polymorphic operations, parameterised abstract types and modules are all supported by a single mechanism.

Poly is strongly typed. All objects have a specification which the compiler can use to check that operations applied to them are sensible. Type errors cannot cause run time faults. The language is safe, meaning that any faults occuring at run time will result in exceptions which can be caught. All veriables must be initialised before use, so faults due to undefined variables cannot occur. Poly allows higher order procedures to be declared and used; these take another procedure as a parameter, or return a procedure as the result. Since Poly is statically scoped, this may still refer to the arguments and local variables of the procedure which returned it.

Poly allows polymorphic operations. Thus, it is possible to write one program to perform an operation on data of any type, provided only that the operation is available for the data type. Abstract types may be created and manipulated. These can be specified in such a way that only the functions to manipulate these objects are available to the user. This has the advantage that the implementation can easily be changed, provided that it has the same external properties. Abstract types can be parameterised so that a set of types can be defined in a single definition. Types in Poly are similar to modules in other languages. For example, types can be separately compiled. An abstract type which makes use of other types can be written as though it were polymorphic; it will work if it is given any type which has the required operations. Its operation may be to return a new type which may be used directly or as a parameter to other polymorphic abstract types.

Full text

PDF (1.4 MB)

BibTeX record

@TechReport{UCAM-CL-TR-63,
  author =	 {Matthews, David C.J.},
  title = 	 {{Poly manual}},
  year = 	 1985,
  month = 	 feb,
  url = 	 {https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-63.pdf},
  institution =  {University of Cambridge, Computer Laboratory},
  number = 	 {UCAM-CL-TR-63}
}