Scheme is a programming language created in 1975 by Guy Steele and Gerald Jay Sussman.
#60on PLDB | 49Years Old | 17kRepos |
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...
(display "Hello, world!")
(newline)
(display "Hello World") (newline)
; Hello World in Scheme
(display "Hello, world!")
(newline)
(define-library (libs basic)
(export list2 x)
(begin
(define (list2 . objs) objs)
(define x 'libs-basic)
(define not-exported 'should-not-be-exported)
))
(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"
case do let loop if else when cons car cdr cond lambda lambda* syntax-rules format set! quote eval append list list? member? load
Feature | Supported | Example | Token |
---|---|---|---|
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 | ✓ | ||
Case Insensitive Identifiers | X | ||
Semantic Indentation | X |