[Next] [Previous] [Top] [Contents] [Index]

"The Cecil Language: Specification and Rationale"

Dynamically-Typed Core


Cecil is a pure object-oriented language. All data are objects, and message passing is the only way to manipulate objects. Even instance variables are accessed solely using message passing. This purity offers the maximum benefit of object-oriented programming, allowing code to manipulate an object with no knowledge of (and hence no dependence on) its underlying representation or implementation.

Each Cecil implementation defines how programs are put together. The UW Cecil implementation defines a program to be a sequence of declaration blocks and statements:

program	::=	file_body
file_body	::=	{ top_decl_block | stmt }

Declaration blocks are comprised of a set of declarations that are introduced simultaneously; names introduced as part of the declarations in the declaration block are visible throughout the declaration block and also for the remainder of the scope containing the declaration block; the names go out of scope once the scope exits. Because the name of an object is visible throughout its declaration block, objects can inherit from objects defined later within the declaration block and methods can be specialized on objects defined later in the declaration block. In environments where the top-level declaration comprising the program is spread across multiple files, the ability to attach methods to objects defined in some other file is important.

The syntax of declarations is as follows:[1]

top_decl_block	::=	{ decl | pragma }
decl	::=	object_decl
	|	obj_ext_decl
	|	predicate_decl
	|	method_decl
	|	field_decl
	|	let_decl
	|	precedence_decl
	|	include_decl

The next four subsections describe objects, methods, fields, and predicate objects. Subsection 2.5 describes variables, statements, and expressions, and subsection 2.6 explains precedence declarations. Subsections 2.7 and 2.8 detail the semantics of message passing in Cecil. Subsection 2.9 describes include declarations and file structure in the UW Cecil implementation, and subsection 2.10 discusses pragmas.


[1] Ignoring type and signature declarations (section 3) and module declarations (section 5).