Skip to content

DeclareProtocol ​

Generated from the engine's own definition: compute-engine's symbol, which we neither extend nor document by hand. No examples yet — the crosswalk is the reason it has a page.

Declare a PROTOCOL: a set of function and property requirements a type may declare itself to satisfy. Protocols are engine-global (not lexically scoped) and are NOT types, so this is only valid at the top level of a program. The name is a symbol (or a string); the optional members ride as a dictionary of member -> ["Pair", "function"|"readonly"|"readwrite", signature], with the signature as a type-expression string. A function member's first parameter must be typed Self, the substitution token standing for the conforming type. A protocol with no members is a SEMANTIC protocol (a marker). An optional third operand ["List", parent, …] names the protocols this one EXTENDS: a type that conforms to it conforms to each of them, and its implementation block may implement their members. The members operand is then required (["Dictionary"] when there are none). Evaluates to Nothing.

DeclareProtocol(string | symbol, members: dictionary<any>?, parents: any?) scope -> nothingas compute-engine declares it
Typed signatures
TypePackageApplies
(string | symbol, members: dictionary<any>?, parents: any?) scope -> nothingcompute-enginealways

Domain: Compute engine

About