Questions tagged [scheme]

Scheme is a functional programming language in the Lisp family, closely modeled on lambda calculus with eager (applicative order) evaluation. FOR questions about URL schemes PLEASE use the tag "URL-scheme".

Scheme is a functional programming language. It is designed to provide a mathematically well-founded language based on lambda calculus (with eager evaluation).

It follows a minimalist design philosophy specifying a small standard core with powerful tools for language extension. Its compactness and elegance have made it popular with educators, language designers, programmers, implementors, and hobbyists.

The Scheme language belongs to the Family. Since Scheme uses a single namespace for naming functions and other values, it is called a lisp-1.

Over the years, attempts at standardizing Scheme have been made including the R5RS standard, the somewhat controversial R6RS, and the most recent standard R7RS which is attempting to split the language into small and large (ongoing) standards.

Free Scheme Programming Books

Implementations

Community Websites

8110 questions
53
votes
10 answers

Functional Programming: what is an "improper list"?

Could somebody explain what an "improper list" is?
jldupont
  • 93,734
  • 56
  • 203
  • 318
52
votes
4 answers

Difference between define, let and set!

Ok, this is a fairly basic question: I am following the SICP videos, and I am a bit confused about the differences between define, let and set!. 1) According to Sussman in the video, define is allowed to attach a value to avariable only once (except…
Andrea
  • 20,253
  • 23
  • 114
  • 183
52
votes
21 answers

Are there people using the Scheme programming language out there?

I have just started to study computer sciences at my university where they teach us programming in Scheme. Since I have learned C++ for the last 6 years, Scheme appears a little odd to me. My instructors tell me you can write any program you can…
NiklasMM
  • 2,895
  • 2
  • 22
  • 26
51
votes
5 answers

Can I use Common Lisp for SICP or is Scheme the only option?

Also, even if I can use Common Lisp, should I? Is Scheme better?
akway
  • 1,738
  • 4
  • 21
  • 20
50
votes
5 answers

Lazy Evaluation vs Macros

I'm used to lazy evaluation from Haskell, and find myself getting irritated with eager-by-default languages now that I've used lazy evaluation properly. This is actually quite damaging, as the other languages I use mainly make lazily evaluating…
Louis
  • 2,442
  • 1
  • 18
  • 15
49
votes
4 answers

Why is foldl defined in a strange way in Racket?

In Haskell, like in many other functional languages, the function foldl is defined such that, for example, foldl (-) 0 [1,2,3,4] = -10. This is OK, because foldl (-) 0 [1, 2,3,4] is, by definition, ((((0 - 1) - 2) - 3) - 4). But, in Racket, (foldl -…
Racket Noob
  • 1,056
  • 1
  • 8
  • 16
48
votes
5 answers

What is the best Scheme interpreter or compiler?

Hey everyone, I want to start using Scheme and I have two questions. First, would you recommend using an interpreter or a compiler for Scheme and why? Second, which interpreter or compiler for Scheme would you recommend and why? Thanks!
adhanlon
  • 6,407
  • 13
  • 43
  • 41
48
votes
10 answers

Why isn't there a good scheme/lisp on llvm?

There is Gambit Scheme, MIT Scheme, PLT Scheme, Chicken Scheme, Bigloo, Larceny, ...; then there are all the lisps. Yet, there's not (to my knowledge) a single popular scheme/lisp on LLVM, even though LLVM provides lots of nice things like: easier…
anon
  • 41,035
  • 53
  • 197
  • 293
47
votes
6 answers

Why code-as-data?

What is code-as-data? I've heard it's superior to "code-as-ascii-characters" but why? I personally find the code-as-data philosophy a bit confusing actually. I've dabbled in Scheme, but I never really got the whole code-as-data thing and wondered…
Peter C
  • 6,219
  • 1
  • 25
  • 37
45
votes
9 answers

What is the closest thing to Slime for Scheme?

I do most of my development in Common Lisp, but there are some moments when I want to switch to Scheme (while reading Lisp in Small Pieces, when I want to play with continuations, or when I want to do some scripting in Gauche, for example). In such…
Ryszard Szopa
  • 5,431
  • 8
  • 33
  • 43
43
votes
2 answers

Help understanding Continuations in Scheme

I have been working alongside The Little Schemer to learn Scheme and using PLT-Scheme for my environment. The Little Schemer has helped me tremendously with recursion (it is straightforward for me now) but I'm stuck on a portion of the book that…
Ixmatus
  • 1,051
  • 9
  • 15
39
votes
3 answers

Why did father of Clojure say that Scheme's true/false are broken?

In this video, Rich Hickey introduced Clojure for Lisp programmers. At time 01:10:42, he talked about nil/false/end-of-sequence/'() among Clojure/Common Lisp/Scheme/Java. He said: "Scheme has true and false, but they are broken." I don't understand…
yehnan
  • 5,392
  • 6
  • 32
  • 38
39
votes
9 answers

Are there any purely functional Schemes or Lisps?

I've played around with a few functional programming languages and really enjoy the s-expr syntax used by Lisps (Scheme in particular). I also see the advantages of working in a purely functional language. Therefore: Are there any purely functional…
38
votes
3 answers

How do I do exponents in Scheme?

pow, ^, ** doesn't work, and Scheme seems to be too common a word to be able to effectively google it.
Claudiu
  • 224,032
  • 165
  • 485
  • 680
38
votes
3 answers

Strange multiplication behavior in Guile Scheme interpreter

I was practicing Scheme in Guile 1.8.8 interpreter on OS X. I noticed something interesting. Here's expt function which is basically does exponentiation expt(b,n) = b^n : (define (square x) (* x x)) (define (even? x) (= (remainder x 2) 0)) …
ahmet alp balkan
  • 42,679
  • 38
  • 138
  • 214