This file is indexed.

/usr/share/doc/r5rs-doc/r5rs/Procedures.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
106
107
108
109
110
111
112
113
<html lang="en">
<head>
<title>Procedures - 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="Primitive-expression-types.html#Primitive-expression-types" title="Primitive expression types">
<link rel="prev" href="Procedure-calls.html#Procedure-calls" title="Procedure calls">
<link rel="next" href="Conditionals.html#Conditionals" title="Conditionals">
<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="Procedures"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Conditionals.html#Conditionals">Conditionals</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Procedure-calls.html#Procedure-calls">Procedure calls</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Primitive-expression-types.html#Primitive-expression-types">Primitive expression types</a>
<hr>
</div>

<h4 class="subsection">4.1.4 Procedures</h4>

<p><a name="index-g_t_0040w_007bprocedures_007d-97"></a>

<div class="defun">
&mdash; syntax: <b>lambda</b><var> &lt;formals&gt; &lt;body&gt;<a name="index-lambda-98"></a></var><br>
<blockquote>
     <p><em>Syntax:</em>
<span class="roman">&lt;Formals&gt;</span> should be a formal arguments list as described below,
and <span class="roman">&lt;body&gt;</span> should be a sequence of one or more expressions.

     <p><em>Semantics:</em>
A lambda expression evaluates to a procedure.  The environment in
effect when the lambda expression was evaluated is remembered as part of the
procedure.  When the procedure is later called with some actual
arguments, the environment in which the lambda expression was evaluated will
be extended by binding the variables in the formal argument list to
fresh locations, the corresponding actual argument values will be stored
in those locations, and the expressions in the body of the lambda expression
will be evaluated sequentially in the extended environment. 
The result(s) of the last expression in the body will be returned as
the result(s) of the procedure call.

     <pre class="format"><tt>(lambda (x) (+ x x))                   ==&gt;  </tt><tt>a procedure
     ((lambda (x) (+ x x)) 4)               ==&gt;  8
     
     (define reverse-subtract
       (lambda (x y) (- y x)))
     (reverse-subtract 7 10)                ==&gt;  3
     
     (define add4
       (let ((x 4))
         (lambda (y) (+ x y))))
     (add4 6)                               ==&gt;  10
     </tt>
</pre>
     <p><span class="roman">&lt;Formals&gt;</span> should have one of the following forms:

          <ul>
<li><tt>(</tt><span class="roman">&lt;variable1&gt;</span><tt> <small class="dots">...</small>)</tt>:
The procedure takes a fixed number of arguments; when the procedure is
called, the arguments will be stored in the bindings of the
corresponding variables.

          <li><span class="roman">&lt;variable&gt;</span>:
The procedure takes any number of arguments; when the procedure is
called, the sequence of actual arguments is converted into a newly
allocated list, and the list is stored in the binding of the
<span class="roman">&lt;variable&gt;</span>.

          <li><tt>(</tt><span class="roman">&lt;variable1&gt;</span><tt> <small class="dots">...</small> </tt><span class="roman">&lt;variable_n&gt;</span> <b>.</b>
<span class="roman">&lt;variable_n+1&gt;</span><tt>)</tt>:
If a space-delimited period precedes the last variable, then
the procedure takes n or more arguments, where n is the
number of formal arguments before the period (there must
be at least one). 
The value stored in the binding of the last variable will be a
newly allocated
list of the actual arguments left over after all the other actual
arguments have been matched up against the other formal arguments.

     </ul>

     <p>It is an error for a <span class="roman">&lt;variable&gt;</span> to appear more than once in
<span class="roman">&lt;formals&gt;</span>.

     <pre class="format"><tt>((lambda x x) 3 4 5 6)                 ==&gt;  (3 4 5 6)
     ((lambda (x y . z) z)
      3 4 5 6)                              ==&gt;  (5 6)
     </tt>
</pre>
     <p>Each procedure created as the result of evaluating a lambda expression is
(conceptually) tagged
with a storage location, in order to make <code>eqv?</code> and
<a name="index-g_t_0040w_007beqv_003f_007d-99"></a><code>eq?</code> work on procedures (see section see <a href="Equivalence-predicates.html#Equivalence-predicates">Equivalence predicates</a>). 
<a name="index-g_t_0040w_007beq_003f_007d-100"></a>
</p></blockquote></div>

</body></html>