Scope Structures and Defined Functions in Lucid
Edward A. Ashcroft, William W. Wadge · Warwick Research Archive Portal (University of Warwick) · 1977
In the paper we describe how Lucid can be extended to allow user-defined functions and scope conventions, i.e. conventions or limiting the range or scope of the validity of definitions. The new 1constructs added (they are called clauses) are similar in form to the blocks and procedure declarations of A1go1-like languages, but are nevertheless strictly non-imperative, because a clause is actually a compound assertion, i.e. an assertion formed aS d program is, by combining a collection of assertions. Each type of clause (there are four) has a straightforward mathematical semantics together with its own characteristic "manipulation rules" for general program massage. In addition, the informal operational view of (some) Lucid programs (described in a previous paper) can be extended to give an (incomplete) operational understanding of the effect of the clauses. In this framework a "compute" clause defines a block; a "mapping clause" defines a conventional (pointwise) function; a "produce" clause defines a block with persistent memory (an anonymous processor 'actor'); and a "function" clause defines a general kind of coroutine.