tinyscheme | Experimental fork of TinyScheme and extensions TSX , RE
kandi X-RAY | tinyscheme Summary
kandi X-RAY | tinyscheme Summary
Experimental fork of [TinyScheme] "D. Souflis, J. Shapiro - TinyScheme Download site") and extensions [TSX] "Manuel Heras-Gilsanz - TinyScheme Extensions"), [RE] "D. Souflis, J. Shapiro - TinyScheme Download").
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of tinyscheme
tinyscheme Key Features
tinyscheme Examples and Code Snippets
Community Discussions
Trending Discussions on tinyscheme
QUESTION
I've just read "A Tutorial Introduction to the Lambda Calculus1" by Raul Rojas. I put the lambda expressions into Scheme (TinyScheme) to try them out. Everything worked except the recursive function to calculate the sum of the Church numbers 0,1,...,N using the Y-combinator which runs out of memory. Bizarrely, the Y-combinator works if I calculate the sum using regular numbers.
Here is my Y-combinator,
...ANSWER
Answered 2021-Apr-23 at 09:54The lambda calculus only works with normal order reduction (i.e. arguments are only evaluated when their values are needed), and Scheme uses applicative order reduction (arguments are evaluated first), except in "special forms".
Your code works with regular numbers not because of the numbers, but because of cond
, which will evaluate at most one of its clauses.
If you replace the cond
in your sum1
with a regular function, your computation will not terminate with regular numbers either.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install tinyscheme
I compiled using "Visual C++ 2010 Express Edition SP1", but "2008" or earlier maybe OK.
Open the Visual Studio command prompt, or open Normal command prompt then run. and change directory to unpacking source files.
To build an executable, just run.
To build as a static library, run with "static" option.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page