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
29
votes
7 answers

Continuations in Clojure

I read somewhere where rich hickey said: "I think continuations might be neat in theory, but not in practice" I am not familiar with clojure. 1. Does clojure have continuations? 2. If no, don't you need continuations? I have seen a lot of good…
unj2
  • 52,135
  • 87
  • 247
  • 375
28
votes
3 answers

Does the yin yang continuations puzzle make sense in a typed language?

This question is related to "How the yin-yang puzzle works?". The yin yang example of continuations in scheme looks like this, according to Wikipedia article: (let* ((yin ((lambda (cc) (display #\@) cc) (call-with-current-continuation (lambda…
Andrej Bauer
  • 2,458
  • 17
  • 26
28
votes
2 answers

How do you load a file into racket via command line?

I have been trying to launch a racket program from the commandline (via 'racket') but have not been having success. According to the documentation (here http://docs.racket-lang.org/reference/running-sa.html#%28part._mz-cmdline%29) passing -f…
Michael McGuinness
  • 283
  • 1
  • 3
  • 4
28
votes
11 answers

How do I learn Scheme?

Hey, I'm a relative newbie to programming. I've picked up some very basic Java (File I/O, GUIs, inheritance) and would like to take a look at functional programming - in particular, I would like to learn Scheme. I'm having some trouble finding a…
Gautam
  • 1,732
  • 4
  • 18
  • 26
28
votes
9 answers

Lisp as a Scripting Language in a C++ app

Hey, I've been looking at the possibility of adding a scripting language into my framework and I heard about Lisp and thought I would give it a go. Is there a VM for Lisp like Lua and Python or am I in the wrong mindset. I found CLISP here,…
Orm
  • 507
  • 6
  • 13
28
votes
7 answers

What does the "world" mean in functional programming world?

I've been diving into functional programming for more than 3 years and I've been reading and understanding many articles and aspects of functional programming. But I often stumbled into many articles about the "world" in side effect computations and…
Eriawan Kusumawardhono
  • 4,796
  • 4
  • 46
  • 49
27
votes
9 answers

In Scheme, how do you use lambda to create a recursive function?

I'm in a Scheme class and I was curious about writing a recursive function without using define. The main problem, of course, is that you cannot call a function within itself if it doesn't have a name. I did find this example: It's a factorial…
NcAdams
  • 2,521
  • 4
  • 21
  • 32
27
votes
4 answers

How to implement the Observer Design Pattern in a pure functional way?

Let's say I want to implement an event bus using a OO programming language. I could do this (pseudocode): class EventBus listeners = [] public register(listener): listeners.add(listener) public unregister(listener): …
ivo
  • 4,101
  • 5
  • 33
  • 42
27
votes
2 answers

What's the proper scheme file extension?

Files of the programming language Scheme are by convention either of the extension .scm or .ss. I'm interested in what the history of these extensions is, and also in the proper use, though it seems the universal attitude is that it's just whatever…
Lara
  • 2,594
  • 4
  • 24
  • 36
27
votes
3 answers

What are the advantages of scheme macros?

Why would anyone prefer Scheme macros over Common Lisp macros (and I genuinely want to know too, I'm not trying to be a troll)? My experience as a Lisp newb is that Common Lisp style macros are much easier to learn than Scheme's macros. I have yet…
Jason Baker
  • 192,085
  • 135
  • 376
  • 510
27
votes
4 answers

Is Clojure closer to Scheme or Common Lisp from a beginner's perspective?

If I want to learn Clojure, should I start by learning Scheme or Common Lisp? Or is Clojure different enough from both of these, that I should just start learning Clojure by itself?
uzo
  • 2,821
  • 2
  • 25
  • 26
27
votes
5 answers

Is there a possibility of multiple statements inside a conditional statement's body?

I'm primarily a C++ (thus an OO/imperative) programmer and I find it quite bizarre that you can only have one statement per evaluation in a conditional statement such as an if-statement in Scheme, a functional language. For example: (let ((arg1 0)…
Alex D.
  • 427
  • 1
  • 5
  • 14
26
votes
2 answers

Why continuation passing style

In The Scheme Programming Language by Kent Dybvig (4th edition) section 3.4, he describes very clearly what continuation passing style is. For the why he gives two reasons: pass more than one result to its continuation, because the procedure that…
Harry Spier
  • 1,395
  • 16
  • 30
26
votes
6 answers

What are some compelling use cases of infinite data structures?

Some languages (Haskell, Clojure, Scheme, etc.) have lazy evaluation. One of the "selling points" of lazy evaluation is infinite data structures. What is so great about that? What are some examples of cases where being able to deal with infinite…
Anas Elghafari
  • 1,062
  • 1
  • 10
  • 20
26
votes
4 answers

In Scheme, what's the point of "set!"?

What's the point of using the set! assignment operator in scheme? Why not just rebind a variable to a new value using define? > (define x 100) > (define (value-of-x) x) ;; value-of-x closes over "x" > x 100 > (value-of-x) 100 > (set! x (+ x 1)) >…
HS.
  • 15,442
  • 8
  • 42
  • 48