/usr/share/doc/r5rs-doc/r5rs/Semantics.html is in r5rs-doc 20010328-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | <html lang="en">
<head>
<title>Semantics - Revised(5) Scheme</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Revised(5) Scheme">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Overview-of-Scheme.html#Overview-of-Scheme" title="Overview of Scheme">
<link rel="prev" href="Overview-of-Scheme.html#Overview-of-Scheme" title="Overview of Scheme">
<link rel="next" href="Syntax.html#Syntax" title="Syntax">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="Semantics"></a>
<p>
Next: <a rel="next" accesskey="n" href="Syntax.html#Syntax">Syntax</a>,
Previous: <a rel="previous" accesskey="p" href="Overview-of-Scheme.html#Overview-of-Scheme">Overview of Scheme</a>,
Up: <a rel="up" accesskey="u" href="Overview-of-Scheme.html#Overview-of-Scheme">Overview of Scheme</a>
<hr>
</div>
<h3 class="section">1.1 Semantics</h3>
<p><a name="index-g_t_0040w_007bsemantics_007d-6"></a>
<p>This section gives an overview of Scheme's semantics. A
detailed informal semantics is the subject of
chapters <a href="Basic-concepts.html#Basic-concepts">Basic concepts</a> through <a href="Standard-procedures.html#Standard-procedures">Standard procedures</a>. For reference
purposes, section <a href="Formal-semantics.html#Formal-semantics">Formal semantics</a> provides a formal
semantics of Scheme.
<p>Following Algol, Scheme is a statically scoped programming
language. Each use of a variable is associated with a lexically
apparent binding of that variable.
<p>Scheme has latent as opposed to manifest types. Types
are associated with values (also called objects) rather than
<a name="index-g_t_0040w_007bobject_007d-7"></a>with variables. (Some authors refer to languages with latent types as
weakly typed or dynamically typed languages.) Other languages with
latent types are APL, Snobol, and other dialects of Lisp. Languages
with manifest types (sometimes referred to as strongly typed or
statically typed languages) include Algol 60, Pascal, and C.
<p>All objects created in the course of a Scheme computation, including
procedures and continuations, have unlimited extent.
No Scheme object is ever destroyed. The reason that
implementations of Scheme do not (usually!) run out of storage is that
they are permitted to reclaim the storage occupied by an object if
they can prove that the object cannot possibly matter to any future
computation. Other languages in which most objects have unlimited
extent include APL and other Lisp dialects.
<p>Implementations of Scheme are required to be properly tail-recursive.
This allows the execution of an iterative computation in constant space,
even if the iterative computation is described by a syntactically
recursive procedure. Thus with a properly tail-recursive implementation,
iteration can be expressed using the ordinary procedure-call
mechanics, so that special iteration constructs are useful only as
syntactic sugar. See section <a href="Proper-tail-recursion.html#Proper-tail-recursion">Proper tail recursion</a>.
<p>Scheme procedures are objects in their own right. Procedures can be
created dynamically, stored in data structures, returned as results of
procedures, and so on. Other languages with these properties include
Common Lisp and ML.
<p>One distinguishing feature of Scheme is that continuations, which
in most other languages only operate behind the scenes, also have
“first-class” status. Continuations are useful for implementing a
wide variety of advanced control constructs, including non-local exits,
backtracking, and coroutines. See section <a href="Control-features.html#Control-features">Control features</a>.
<p>Arguments to Scheme procedures are always passed by value, which
means that the actual argument expressions are evaluated before the
procedure gains control, whether the procedure needs the result of the
evaluation or not. ML, C, and APL are three other languages that always
pass arguments by value.
This is distinct from the lazy-evaluation semantics of Haskell,
or the call-by-name semantics of Algol 60, where an argument
expression is not evaluated unless its value is needed by the
procedure.
<p>Scheme's model of arithmetic is designed to remain as independent as
possible of the particular ways in which numbers are represented within a
computer. In Scheme, every integer is a rational number, every rational is a
real, and every real is a complex number. Thus the distinction between integer
and real arithmetic, so important to many programming languages, does not
appear in Scheme. In its place is a distinction between exact arithmetic,
which corresponds to the mathematical ideal, and inexact arithmetic on
approximations. As in Common Lisp, exact arithmetic is not limited to
integers.
</body></html>
|