tinyscheme | TinyScheme is easy to learn and modify | Interpreter library
kandi X-RAY | tinyscheme Summary
kandi X-RAY | tinyscheme Summary
TinyScheme is a lightweight Scheme interpreter that implements as large a subset of R5RS as was possible without getting very large and complicated. It is meant to be used as an embedded scripting interpreter for other programs. As such, it does not offer IDEs or extensive toolkits although it does sport a small top-level loop, included conditionally. A lot of functionality in TinyScheme is included conditionally, to allow developers freedom in balancing features and footprint. As an embedded interpreter, it allows multiple interpreter states to coexist in the same program, without any interference between them. Programmatically, foreign functions in C can be added and values can be defined in the Scheme environment. Being a quite small program, it is easy to comprehend, get to grips with, and use. This version was modified to support CMake projects for easier embedding. Few bugs were fixed and improved. Read Manual.txt for more information.
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
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