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

Newton's square root method in Scheme or Common Lisp

I am not able to figure out the error in this program. This is the Scheme version. I tried Common Lisp version as well. In both cases, the program keeps running without any result. Please help. (define (sqrt1 x) (define (square x) (* x…
Amar
  • 33
  • 1
  • 7
3
votes
0 answers

Macro to use dot.notation to get structure fields in Racket

For a structure and its instance defined as follows: (struct dog (name breed age)) (define mydog (dog "lassie" "collie" 5)) (example from https://learnxinyminutes.com/docs/racket/) The usual way to get a structure field is as follows: (dog-name…
rnso
  • 23,686
  • 25
  • 112
  • 234
3
votes
1 answer

DrScheme versus mzscheme: treatment of definitions

One long term project I have is working through all the exercises of SICP. I noticed something a bit odd with the most recent exercise. I am testing a Huffman encoding tree. When I execute the following code in DrScheme I get the expected result: (a…
speciousfool
  • 2,620
  • 5
  • 28
  • 33
3
votes
1 answer

How to scroll up to last entry in mit-scheme REPL?

I'm learning scheme programming from sicp textbook. I'm very new in scheme. I have installed REPL for this. I don't know, How to scroll up in REPL? For example: 1 ]=> (define x 5) ;Value: x 1 ]=> x ;Value: 5 Now when I tied to scroll up value…
rishi kant
  • 1,235
  • 1
  • 9
  • 28
3
votes
1 answer

What is the significance of `flatmap` in SICP?

(define (accumulate op initial sequence) (if (null? sequence) initial (op (car sequence) (accumulate op initial (cdr sequence))))) (define (flatmap proc seq) (accumulate append nil (map proc seq))) The above is a code…
Jack Black
  • 65
  • 5
3
votes
1 answer

How to statically link a Chicken Scheme program that uses extensions?

I have need to compile and statically link a Chicken program. I expect to use many extensions, most notably http-client. I can compile the source with the following command: csc -compile-syntax -static linux-setup.scm or csc -R http-client…
Sod Almighty
  • 1,768
  • 1
  • 16
  • 29
3
votes
1 answer

Piping in Racket

Is it possible to have piping in Racket with output of one function going to next. For example, can following code be rewritten: (define (safestr sentstr) (list->string (remove* (list #\| #\; #\: #\/ #\\ #\' #\") (string->list…
rnso
  • 23,686
  • 25
  • 112
  • 234
3
votes
1 answer

Is there an equivalent of Common Lisp's *print-circle* in Scheme?

I'm working on a deque in Scheme (SICP exercise 3.23) and I've got a simple doubly-linked list implementation I would like to test out, but I can't seem to find out how to print out a circular list in Scheme (mit-scheme and mzscheme/racket). In CL…
okonomichiyaki
  • 8,355
  • 39
  • 51
3
votes
2 answers

How to use console as input and output for Guile Scheme?

I understand that Scheme uses ports to perform Input and Output. While trying to learn how to get console input and output, I have come across MIT-Scheme's console-i/o-port variable. But, the guile interpreter says it is an Unbound Variable. I would…
Tarun Maganti
  • 3,076
  • 2
  • 35
  • 64
3
votes
2 answers

Default argument in scheme lambda function?

I recently started using ChickenScheme and now I want to declare a function with default argument (if not specified). I found this example on the Racket site, I know Racket and ChickenScheme are different but I thought that these basic things were…
Andrea Ciceri
  • 436
  • 6
  • 16
3
votes
1 answer

scheme: Wrong type argument in position

I'd really appreciate it if some-one can help with this. I've been banging my head for a day trying to get this to work. I've searched the internet and reread the manual but I just don't understand. guile << __EOF__ ( define heading-list (list 'a…
Chris Good
  • 156
  • 10
3
votes
1 answer

This scheme function seems to be tail recursive, so why am I getting a stack overflow

I recently have been messing around with scheme for the first time in years. I'm using repl.it to play around a bit. I wrote this basic function to take a list and return a doubly-linked list. Each cell of the list is a pair whose car is the list…
Gabriel Burns
  • 345
  • 1
  • 2
  • 9
3
votes
8 answers

Compile lisp / scheme in Notepad++

I'm pretty much into lisp at the moment, and unfortunately i'm only available to code on windows. Is is possible to let Notepad++ take care of the interpreting of my scripts, and display the output in the compiler window? If yes, what interpreter…
Alexander Nyquist
3
votes
3 answers

Why aren't these two equal?

I was preparing for a test and I noticed this question: Define an object x so that (eq? (car x) (cdr x)) returns #t I initially thought that it would be pretty simple. cdr x is a list and car x is a single element, so my guess would've been make…
Xzenon
  • 1,193
  • 2
  • 15
  • 37
3
votes
0 answers

Lisp on Android

I'm interested in getting started with Android development and would like to use a Lisp-style language. However, I want something that won't limit me if I choose to write a complex app, so it also needs to have reasonable performance, executable…
Qudit
  • 472
  • 4
  • 14
1 2 3
99
100