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
38
votes
2 answers

Y combinator discussion in "The Little Schemer"

So, I've spent a lot of time reading and re-reading the ending of chapter 9 in The Little Schemer, where the applicative Y combinator is developed for the length function. I think my confusion boils down to a single statement that contrasts two…
planarian
  • 2,047
  • 18
  • 18
37
votes
3 answers

Clearing the screen by printing a character?

I'm using chez-scheme and I can't find a way to clear the screen completely. (If someone knows a better way than printing I'd be interested in that too but it's not my question here) From what I can find clearing the screen by ^L (control-L) or…
Lara
  • 2,594
  • 4
  • 24
  • 36
37
votes
8 answers

Scheme IDE for Windows

What is a good Scheme IDE for Windows? OK, I'll admit it; I'm not at RMS's level, and don't want to use Emacs or any character-based interface -- I want a graphic IDE with colorization, a REPL, and usable, in-line help for a specific,…
Joshua Fox
  • 18,704
  • 23
  • 87
  • 147
36
votes
1 answer

What exactly is a "continuation prompt?"

I'm trying to decipher the documentation call-with-continuation-prompt Applies proc to the given args with the current continuation extended by a prompt. The prompt is tagged by prompt-tag, which must be a result from either…
36
votes
6 answers

No idea how to solve SICP exercise 1.11

Exercise 1.11: A function f is defined by the rule that f(n) = n if n < 3 and f(n) = f(n - 1) + 2f(n - 2) + 3f(n - 3) if n > 3. Write a procedure that computes f by means of a recursive process. Write a procedure that computes f by means of an…
Javier
  • 4,552
  • 7
  • 36
  • 46
35
votes
9 answers

Which Scheme IDE's are there?

I am planning on learning Scheme (by following SICP) and afterwards doing a project with this language. However, I was wondering what would be a good IDE for this? I've looked around a bit, but could not really find very much, except something…
KnowsLittle
  • 1,197
  • 2
  • 13
  • 20
35
votes
4 answers

Why are Python and Ruby so slow, while Lisp implementations are fast?

I find that simple things like function calls and loops, and even just loops incrementing a counter take far more time in Python and Ruby than in Chicken Scheme, Racket, or SBCL. Why is this so? I often hear people say that slowness is a price you…
ithisa
  • 752
  • 1
  • 8
  • 25
35
votes
3 answers

Which lang packet is proper for SICP in Dr.Racket?

I'm trying with SICP and I got some code. So I started with: #lang scheme (word 'comp 'uter) Returned error: Function (word) undefined. Even if I tried to copy this into IDE(Run): (define word? (let ((number? number?) (symbol? symbol?) …
user2871676
34
votes
3 answers

Commenting code in Scheme

I am looking at some code in Scheme from Festival and cannot seem to figure out the comments. Currently, I can see ;, ;; and ;;; used to indicate comment lines. Other sources on the web indicate that some of the above maybe ways to indicate…
Sriram
  • 10,298
  • 21
  • 83
  • 136
34
votes
6 answers

How does the yin-yang puzzle work?

I'm trying to grasp the semantics of call/cc in Scheme, and the Wikipedia page on continuations shows the yin-yang puzzle as an example: (let* ((yin ((lambda (cc) (display #\@) cc) (call-with-current-continuation (lambda (c) c)))) …
Hrundik
  • 1,818
  • 13
  • 13
34
votes
5 answers

Is there an equivalent to Lisp's "runtime" primitive in Scheme?

According to SICP section 1.2.6, exercise 1.22: Most Lisp implementations include a primitive called runtime that returns an integer that specifies the amount of time the system has been running (measured, for example, in microseconds). I'm using…
Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
34
votes
4 answers

scheme continuations for dummies

For the life of me, I can't understand continuations. I think the problem stems from the fact that I don't understand is what they are for. All the examples that I've found in books or online are very trivial. They make me wonder, why anyone would…
user2379016
  • 351
  • 3
  • 5
33
votes
7 answers

What is the difference between 1 and '1 in Lisp?

I had never really thought about whether a symbol could be a number in Lisp, so I played around with it today: > '1 1 > (+ '1 '1) 2 > (+ '1 1) 2 > (define a '1) > (+ a 1) 2 The above code is scheme, but it seems to be roughly the same in Common…
Jason Baker
  • 192,085
  • 135
  • 376
  • 510
33
votes
18 answers

Which language would you use for the self-study of SICP?

I've caught the bug to learn functional programming for real. So my next self-study project is to work through the Structure and Interpretation of Computer Programs. Unfortunately, I've never learned Lisp, as I was not a CS major in college. While…
Alan
  • 7,066
  • 5
  • 30
  • 38
33
votes
4 answers

conda, condi, conde, condu

I'm reading the Reasoned Schemer. I have some intuition about how conde works. However, I can't find a formal definition of what conde/conda/condu/condi do. I'm aware of https://www.cs.indiana.edu/~webyrd/ but that seems to have examples rather than…
user1383359
  • 2,673
  • 2
  • 25
  • 32