Questions Concepts
GitHub icon

Scheme

Scheme - Programming language

< >

Scheme is a programming language created in 1970 by Guy Steele and Gerald Jay Sussman.

#50on PLDB 53Years Old 17kRepos

Try now: Riju · Replit

Scheme is a functional programming language and one of the two main dialects of the programming language Lisp. Unlike Common Lisp, the other main dialect, Scheme follows a minimalist design philosophy specifying a small standard core with powerful tools for language extension. Scheme was created during the 1970s at the MIT AI Lab and released by its developers, Guy L. Read more on Wikipedia...


Example from Riju:
(display "Hello, world!") (newline)
Example from hello-world:
(display "Hello World") (newline)
; Hello World in Scheme (display "Hello, world!") (newline)
Example from Linguist:
(define-library (libs basic) (export list2 x) (begin (define (list2 . objs) objs) (define x 'libs-basic) (define not-exported 'should-not-be-exported) ))
Example from Wikipedia:
(set! + (let ((original+ +)) (lambda args (if (and (not (null? args)) (string? (car args))) (apply string-append args) (apply original+ args))))) (+ 1 2 3) ===> 6 (+ "1" "2" "3") ===> "123"
Scheme Keywords
case do let loop if else when cons car cdr cond lambda lambda* syntax-rules format set! quote eval append list list? member? load

Language features

Feature Supported Token Example
Conditionals
Strings "
"Hello world"
MultiLine Comments #| |#
#| A comment
|#
Print() Debugging display
Homoiconicity
Prefix Notation
(+ 1 2 3)
Macros
(define-syntax backwards
 (syntax-rules ()
   ((_) (syntax-error "(backwards) not allowed"))
   ((_ e) e)
   ((_ e1 ... e2)
    (begin e2 (backwards e1 ...)))))
Line Comments ;
; A comment
Comments
Lispy
Case Insensitive Identifiers X
Semantic Indentation X

View source

- Build the next great programming language · Search · Add Language · Features · Creators · Resources · About · Blog · Acknowledgements · Queries · Stats · Sponsor · Traffic · Traffic Today · Day 305 · feedback@pldb.com · Logout