Questions tagged [scheme]
Scheme is a functional programming language in the Lisp family, closely modeled on lambda calculus with eager (applicative-order) evaluation.
171 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
4
votes
1
answer
106
views
Implement a matrix and access its elements
I have just started to learn how to program in Scheme using the LispPad app on my iPad. I want to know if the following is the best way to implement a matrix and access its elements.
This code ...
2
votes
0
answers
77
views
Higher-order procedures for tree manipulation in SICP
I'm working my way through Structure and Interpretation of Computer Programs and got to exercises 2.27-2.28, reproduced here:
Exercise 2.27. Modify your reverse procedure of exercise 2.18 to
produce ...
1
vote
2
answers
142
views
Trie Data Structure in R7RS Scheme
Making the transition from R6RS Scheme to R7RS has been very educational and
fun. Chibi Scheme is my favorite because of its close compliance with the
standard.
When starting a new project, I wanted ...
2
votes
1
answer
168
views
Performant Text File Reading in Scheme
I have been experimenting with methods to read large text files into a Scheme
program as a single string in a performant manner. Development has been in
R7RS Scheme, specifically Chibi-Scheme.
After ...
3
votes
1
answer
129
views
Brute-force algorithm to solve allocation/assignment in Racket
The situation: A certain number of kids come to a library and each of them wants to borrow a book. Since there is only one copy of each book in the library, each child must say which book they would ...
5
votes
0
answers
97
views
Scheme interpreter in QBASIC
I wrote an interpreter for Scheme which includes stop and copy garbage collection.
...
3
votes
0
answers
64
views
Idiomatic PRNG in Scheme
For reasons that are too dreary to detail, I need to reproduce several pseudo
random number generators in different languages. It mostly involves translating
ancient C and FORTRAN code. No problems ...
2
votes
0
answers
72
views
Deterministic and nondeterministic finite automata in scheme
This is the implementation of both Deterministic Finite Automata (DFAs) and
Nondeterministic Finite Automata (NFAs) on r7rs scheme, using only
SRFI 1.
The file automata.scm contains the implementation ...
3
votes
0
answers
133
views
Mini Scheme interpreter
Right now, I'm working on an interpreter for a subset of the Scheme programming language. It supports lambdas, let/let*/letrec, procedures, combinations, ...
1
vote
2
answers
423
views
Flattening a List containing Empty Lists
As part of a text buffer implemented as a piece table, there is an often called procedure to flatten a nested list of character lists. The function is part of constructing substrings of the buffer for ...
1
vote
1
answer
616
views
"filter" function in Scheme
I know this is a bit elementary, but I am highly uncomfortable writing Scheme code, and I want to make sure that what I'm doing is good practice. I know mutation is frowned upon in Scheme.
I have no ...
3
votes
0
answers
140
views
Performance issue regarding Project Euler #60 in Scheme
I solved Project Euler #60:
The primes 3, 7, 109, and 673, are quite remarkable. By taking any two primes and concatenating them in any order the result will always be prime. For example, taking 7 ...
0
votes
0
answers
122
views
Is this zip function ok?
A slick way to write the zip function in Scheme/Racket:
(define (zip . lsts)
(apply map list lsts))
(zip '(a b c) '(1 2 3))
'((a 1) (b 2) (c 3))
Is using cons ...
-1
votes
1
answer
89
views
1
vote
2
answers
553
views
Implementations of unzip in Racket
I've been practicing my folds and tail-call recursive programming, and I wanted to work on unzip for the general case as opposed to just pairs. This was very easy ...