<p>The terms of the lambda calculus essentially represent a subset of scheme terms. For instance, most people would agree that</p>

<pre><code>(lambda (x) (x x))
</code></pre>

<p>is a term in the lambda calculus and also in scheme, and also that they mean "similar" things. When it comes to evaluation things get a bit more interesting; the lambda calculus, in its purest form, consists of a single rule (beta) that can be applied in arbitrary locations, whereas scheme--as an eager, call-by-value language--applies the beta rule only in certain locations.</p>

<p>Sounds like you should ask follow-up questions?</p>

CC BY-SA 3.0
2015-02-12T00:38:42.263Z
As I understand it, lambda calculus allows us to abstract functions into a one-variable, generic, no-name entity -- which I can sort of see with your example. But my factor example, well, obviously doesn't do currying, but it does go into recursion and multiplication, which seems to be "jumping ahead" of any sort of pure lambda calculus I've seen. Obviously, Scheme isn't doing pure lambda calculus to get the answer. So what about Scheme is lambda calculus?
147pm
CC BY-SA 3.0
2015-02-12T20:17:25.120Z
I think the best answer here is simply: scheme implements a superset of the lambda calculus. When you say "doing lambda calculus", I think you mean "rewriting terms using the beta rule (and maybe others)." The connection here is that scheme respects the lambda calculus, in the sense that if you're careful to apply the rules only in certain contexts (cf. Felleisen & evaluation contexts), the lambda calculus will "produce" the same set of values that scheme's evaluation function does. Please forgive me for being only as formal as I choose to be...
John Clements
CC BY-SA 3.0
2015-02-11T23:37:27.187Z
2015-02-11T23:37:27.187Z
John Clements
<p>For example:</p>

<pre><code>(define fact
    (lambda (n)
        (if (&lt; n 2) 1 (* n (fact (- n 1)))))
</code></pre>

<p>How is this an example of applied lambda calculus? I tried to read the Steele paper (or for that matter, the Peyton-Jones paper), but got confused when they made the jump from the description of lambda calculus to the application thereof in Scheme.</p>

CC BY-SA 3.0
2015-02-11T23:08:53.643Z
This question might be more suitable at [https://cs.stackexchange.com](https://cs.stackexchange.com/).
Martin Berger
<lambda-calculus><scheme>
How is does a scheme lambda function relate to lambda calculus?
147pm
# How is does a scheme lambda function relate to lambda calculus?

(Asked by: username_0 on 2015-02-11)

For example:
(define fact
    (lambda (n)
        (if (< n 2) 1 (* n (fact (- n 1)))))

How is this an example of applied lambda calculus? I tried to read the Steele paper (or for that matter, the Peyton-Jones paper), but got confused when they made the jump from the description of lambda calculus to the application thereof in Scheme.

**Tags:** lambda-calculus, scheme
> **Comments:**
> **username_1**: This question might be more suitable at [https://cs.stackexchange.com](https://cs.stackexchange.com/).  

---

## 1 answers

### Answer by username_2 on 2015-02-11. Score: 2

The terms of the lambda calculus essentially represent a subset of scheme terms. For instance, most people would agree that
(lambda (x) (x x))

is a term in the lambda calculus and also in scheme, and also that they mean "similar" things. When it comes to evaluation things get a bit more interesting; the lambda calculus, in its purest form, consists of a single rule (beta) that can be applied in arbitrary locations, whereas scheme--as an eager, call-by-value language--applies the beta rule only in certain locations.
Sounds like you should ask follow-up questions?

> **Comments:**
> **username_0**: As I understand it, lambda calculus allows us to abstract functions into a one-variable, generic, no-name entity -- which I can sort of see with your example. But my factor example, well, obviously doesn't do currying, but it does go into recursion and multiplication, which seems to be "jumping ahead" of any sort of pure lambda calculus I've seen. Obviously, Scheme isn't doing pure lambda calculus to get the answer. So what about Scheme is lambda calculus?  
> **username_2**: I think the best answer here is simply: scheme implements a superset of the lambda calculus. When you say "doing lambda calculus", I think you mean "rewriting terms using the beta rule (and maybe others)." The connection here is that scheme respects the lambda calculus, in the sense that if you're careful to apply the rules only in certain contexts (cf. Felleisen & evaluation contexts), the lambda calculus will "produce" the same set of values that scheme's evaluation function does. Please forgive me for being only as formal as I choose to be...  

---

