login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for SandboxTypeDefinitions revision 6 of 15

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Editor: Bill Page
Time: 2008/07/08 07:33:36 GMT-7
Note: Aldor Users Guide, chapter 7

added:

From BillPage Tue Jul 8 07:33:36 -0700 2008
From: Bill Page
Date: Tue, 08 Jul 2008 07:33:36 -0700
Subject: Aldor Users Guide, chapter 7
Message-ID: <20080708073336-0700@axiom-wiki.newsynthesis.org>

Section 7.5 Subtypes

  Every value in Aldor is a member of a unique domain which determines the interpretation of its data.

Section 7.9 Categories

  All type values have ``Type'' as their unique base type. As with all other values, it is the unique base type which determines how values are to be represented.

  The language allows categories to be treated as normal values and allows names to refer to categories. A category (by definition) is a value of the Aldor built-in type Category.

There seems to be different understandings of Type, domain, category, Category, etc. around. Here is an attempt to collect all these different opinions in order to make discussion about them clearer.

Definitions of Ralf Hemmecke

A category is an L-type whose type is the language-defined constant Category.

A domain is an L-type whose type is a category.

An L-type is either a category, a domain or the language-defined constants Category and Type.

Any L-type is of type Type.

I wrote L-type to mean type in the language, either Aldor or SPAD.

Each value belongs to ... its domain --Bill Page, Tue, 08 Jul 2008 06:53:30 -0700 reply
In

Stephen Watt wrote:
The type system has two levels: Each value belongs to some unique type, known as its domain, and the domains of expressions can be inferred statically. Each domain is itself a value belonging to the domain Type. Domains may additionally belong to some number of subtypes (of Type), known as categories. Categories can specify properties of domains such as which operations they export, and are used to specify interfaces and inheritance hierarchies.
 
The biggest difference between the two-level domain/category model and the single-level subclass/class model is that a domain is an element of a category, whereas a subclass is a subset of a class. This difference eliminates a number of problems in the definition of functions with multiple related arguments.

The Aldor User Guide says... --hemmecke, Tue, 08 Jul 2008 07:26:33 -0700 reply
In Section 7.2 of the AUG is written:

  • A domain is a type which defines a collection of exported symbols. The symbols may denote types, constants and functions. Many domains also define an interpretation for data values, called a representation type; these domains are also known as abstract data types. Those domains which are not abstract datatypes are called packages.
  • A category is a type which specifies information about domains, including the specification of the public interface to a domain, which consists of a collection of declarations for those operations which may be used by clients of the domain.

That conflicts the above statement that Type is a domain, but is in line with the two-level domain/category model.

See also Sections 7.8 (Domains) and 7.9 (Categories) of the Aldor User Guide.

I haven't (yet) found a sentence that says that Type or Category are domains.

Aldor Users Guide, chapter 7 --Bill Page, Tue, 08 Jul 2008 07:33:36 -0700 reply
Section 7.5 Subtypes

Every value in Aldor is a member of a unique domain which determines the interpretation of its data.

Section 7.9 Categories

All type values have ``Type'' as their unique base type. As with all other values, it is the unique base type which determines how values are to be represented.

The language allows categories to be treated as normal values and allows names to refer to categories. A category (by definition) is a value of the Aldor built-in type Category.