Object and Method Semantics

To be replaced by output from the manual.

Prototype-based Objects

Slate descends from the Self programming language, where object-centered development is emphasized. So, instead of instantiating classes to form new objects, pre-existing objects are copied or cloned and modified to produce new ones. Re-use of existing code, data, and behavior is accomplished through delegation between objects: whenever a service is requested of an object which is not defined directly by it, it consults the objects in slots marked for delegation for the same services with the original object as the argument.

Slate, however, takes after Smalltalk in that the syntax distinguishes between objects and block closures (or methods) syntactically. The literal object syntax of Self does not carry forward into Slate.

Objects and Slots, and Delegation

Slate provides several primitive messages to manage slots:

object addSlot: slotSymbol
Adds a slot using the symbol as its name, initialized to Nil.
object addSlot: name valued: val
Adds a slot under the given name and initializes its value to the given one.
object addDelegate: slotSymbol and object addDelegate: slotSymbol valued: val
Adds a delegation slot, and initializes it, respectively. It is usually preferred to use the latter since delegation to Nil is unsafe.

Each of the former has a variant which doesn't result in a mutator method being generated for its slot: addImmutableSlot:valued: and addImmutableDelegate:valued:.

The Primitive Object Hierarchy

Root
The "root" object, upon which all the very basic methods of slot manipulation are defined.
Oddball
The branch of Root representing non-cloneable objects.
Nil
Nil is an Oddball representing "no-object".
Derivable
Derivable objects respond to derive and deriveWith:, which means they can be readily extended.
Cloneable
Cloneable objects are derivables that can be cloned.
Method
A Cloneable object with attributes for supporting execution of blocks and holding compiled code and its attributes.

Methods

Multiple-Dispatch

Objects and Roles

Co-operative Lookup

Methods are Annotated Block Closures

Initial Primitives

Numerics

All of the normal arithmetic operations are supported primitively between elements of the same type. Type coercion has to be done entirely in code, no implicit coercions are performed by the virtual machine. The interpreter also transparently provides unlimited-size integers, although the bootstrapped system may not do so implicitly.

The following are the rest of the operations, given with an indication of their "signatures":