Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
1 answer
579 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 ...
Joseph Gutstadt's user avatar
1 vote
0 answers
655 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
  • 841
2 votes
2 answers
103 views

Proper use of tail recursion while forming a list

As a project to better develop my understanding of functional programming, I am writing a prime number generator in Scheme. I am using a simple brute-force algorithm to detect whether a number is ...
penguin359's user avatar
3 votes
1 answer
478 views

Church Numerals

Here is exercise 2.6 from SICP: Exercise 2.6: In case representing pairs as procedures wasn’t mind-boggling enough, consider that, in a language that can manipulate procedures, we can get by ...
lightning_missile's user avatar
6 votes
1 answer
1k views

All possible ways of merging two lists while keeping their order

I am writing a function gives all possible ways of merging two ordered lists such that in the merged list, the elements are still ordered according to the elements in their respective starting list. ...
samlaf's user avatar
  • 163
7 votes
2 answers
548 views

My first accumulators

Notes I'm working my way through SICP, and as I got very confused by the section on folds, I decided to try to implement foldr in scheme and javascript to understand how it works differently with ...
Racheet's user avatar
  • 217
2 votes
2 answers
2k views

Counting Ways to Make Change -- Is this good functional/Lisp style?

I have just started learning some Scheme this weekend. I recently solved a problem that goes something like: ...
daniel gratzer's user avatar
1 vote
1 answer
238 views

Optimize this Scheme-written chess engine module

I'd like to know how to optimize this by shadowing symbols 'lo and 'hi inside nested function f. I guess CPS conversion would solve this but how? ...
Samuel Duclos's user avatar