In Landin's view, the -calculus acts as a kind of mathematical analogue of
machine code - it is a form that it is simple to reason about, in the
same way that machine code is a form that it is simple for a machine to
execute.
Let us take a preview of some `syntactic sugar' in ML and Modula-2. The
calculus expression
x. + x 2 is rendered in ML as
fn x => x+2
Here the
Another piece of syntactic sugar is the let construct in ML.
is replaced by fn. This is hardly sugar at all, but
reflects the poverty of the ASCII alphabet. Likewise the `.' is replaced by
`$=>$', which avoids confusion with other uses of `.', e.g. as a decimal
point, although we shall see that the syntactic constructions in which
`$=>$' occurs in ML provide much more than simple
abstraction. The
last piece of syntactic sugar is to write `x+2' in place of
`$+ x 2', in accordance with usual mathematical notation.
let val x = 3 in x+7 end
can be translated into -calculus as (
x. + x 7)3. Note that
E1 and E2 in (
x. E1) E2 change their order in the let
construct. This often accords with programming language practice.