Scope

A type is a scope. This notion itself has a specific meaning in the context of C++ (more or less shared with other statically typed languages). A scope is both a namespace and a collection of blocks. By block, I mean here the basic grounding of structured programming: a sequential list of operations, with one unique entry point (the common exit point may even be virtual).

In sequential programming, and even with functions calls, blocks build up an algebra: coalescing two blocks builds up a block.

Blocks are missing from signature based notions of interface, such as in CORBA IDL or Java.

RPC doesn't respect blocks: it doesn't guarantee the unicity of the entry point, and thus neither the state of the resources accessed within the procedure.

Types being based upon blocks allows for the static guarantee of assertions, that can be made upon sequences of commands. It works as a way to convert an imperative paradigm into a declarative one!


Table of contents, type
Marc Girod
Last modified: Sat Feb 28 14:30:26 EET 1998