Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [scheme]

Scheme is a functional programming language in the Lisp family, closely modeled on lambda calculus with eager (applicative-order) evaluation.

22 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
0 answers
611 views

Standard Algebraic Derivative Calculator

I had some difficulty with this problem, so I'm sure there is a better way. Here is the question from SICP: Exercise 2.58 Suppose we want to modify the differentiation program so that it ...
jaresty's user avatar
  • 2,243
4 votes
0 answers
66 views

Scheme interpreter in QBASIC

I wrote an interpreter for Scheme which includes stop and copy garbage collection. ...
Dean Menezes's user avatar
4 votes
0 answers
353 views

Solving Sudokus in Scheme Using Simulated Annealing

This program's purpose is to solve sudokus using simulated annealing. It first fills all the 3x3 blocks in the sudoku such that every block is filled with 1-9. It also builds a list of pairs of ...
Lara's user avatar
  • 195
4 votes
0 answers
313 views

Quick Insert Merge Sort

I have written this code to sort a list of numbers, in increasing order. It is a combination of quick sort, insertion sort, and merge sort. I make the first element of the list a pivot, then I go ...
Rajesh Bhat's user avatar
4 votes
0 answers
499 views

Search on a binary tree

From SICP: Exercise 2.66. Implement the lookup procedure for the case where the set of records is structured as a binary tree, ordered by the numerical values of the keys. I wrote the ...
jaresty's user avatar
  • 2,243
3 votes
0 answers
51 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 ...
clartaq's user avatar
  • 247
3 votes
0 answers
115 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, ...
TheSinisterStone's user avatar
3 votes
0 answers
123 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 ...
Jay Lee's user avatar
  • 151
3 votes
0 answers
676 views

Knapsack solution in Scheme/Racket

Following is my solution to Knapsack problem using all combinations of the sent list of items (in Racket programming language). Although it is very short, I am sure it can be improved in many ways. <...
rnso's user avatar
  • 241
3 votes
0 answers
328 views

Converting a sentence string to a number in Scheme

I wrote a scheme procedure that converts strings such as "Two hundred and fifty" into a number like "250" that I can use in math calculations (It's for some Natural Language Processing project). Is ...
Dawit Abraham's user avatar
3 votes
0 answers
185 views

Graphical editor with geometric intersection

If it is possible I would like some comments on the overall style of the program. It feels like I am writing the whole program as one big script and I'm not sure how to break it down into several ...
KRC's user avatar
  • 143
3 votes
0 answers
200 views

Calculating continued fraction expansions (without requiring arbitrary precision decimals)

I'm writing a program that will compute a continued fraction expansion of a number. I've been learning Racket/Scheme for a few weeks and I wanted to see what I can do better. Usage: This program ...
Chris Brooks's user avatar
2 votes
0 answers
54 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 ...
phillbush's user avatar
  • 864
2 votes
0 answers
41 views

A scheme macro that defines the "where“ syntax

A new scheme user trying to use syntax-rules to define something like the Haskell where keyword. Sometimes this is useful since ...
Earth Engine's user avatar
2 votes
0 answers
160 views

A with-input-from-pipe for Guile

I wrote this with-input-from-pipe function for Guile. I’m not that comfortable with dynamic-wind or ...
Robert Fisher's user avatar
2 votes
0 answers
114 views

`multiple-value-call` in Scheme

Common Lisp has a "special operator" called multiple-value-call, which does something similar to Scheme's call-with-values but ...
C. K. Young's user avatar
  • 2,342
2 votes
0 answers
80 views

String matching

I recently came across a lecture on DFA. I tried to use it to determine whether a given 'search string' is found in the 'input string'. Please tell me if there is a better way. ...
Rajesh Bhat's user avatar
2 votes
0 answers
415 views

Coercion with multiple arguments

From SICP: Exercise 2.82 Show how to generalize apply-generic to handle coercion in the general case of multiple arguments. One strategy is to attempt to coerce all the arguments to ...
jaresty's user avatar
  • 2,243
2 votes
0 answers
1k views

Union-set intersection-set for a binary-tree implementation of sets

From SICP: Exercise 2.65 Use the results of exercises 2.63 and 2.64 to give (n) implementations of union-set and intersection-set for sets implemented as (balanced) binary trees.41 I ...
jaresty's user avatar
  • 2,243
1 vote
0 answers
110 views

Simply Scheme book: "functions.scm", How to use basic language constructs to create interactive prompt for function application

While reading Simply Scheme by Brian Harvey and Matthew Wright: Part I: Chapter 2 Functions In this chapter you are going to use the computer to explore functions, but you are not going to use the ...
RacketeerHaskeller's user avatar
1 vote
0 answers
86 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 ...
X10D's user avatar
  • 119
1 vote
0 answers
649 views

Cartesian product in racket (Is append-map okay?)

I've read several places that say it's really bad to use append, and I understand why. I read somewhere that it was never even correct to use ...
BrainFRZ's user avatar
  • 819