Scheme
'''Scheme''' is a multi-paradigm programming language. It is one of the two main dialects of derived from::Lisp and supports a number of programming paradigms; however it is best known for its support of functional programming. It was developed by Guy L. Steele and Gerald Jay Sussman in the 1970s. Scheme was introduced to the academic world via a series of papers, now referred to as Sussman and Steele's Lambda Papers. There are two standards that define the Scheme language: the official IEEE standard, and a de facto standard called the ''Revisedn Report on the Algorithmic Language Scheme'', nearly always abbreviated R''n''RS, where ''n'' is the number of the revision. The current standard is '''R7RS''', with '''R5RS''' and, less common, '''R6RS''' still in use.
Scheme's philosophy is minimalist. Scheme provides as few primitive notions as possible, and, where practical, lets everything else be provided by programming libraries.
Scheme was the first dialect of Lisp to choose static (a.k.a. lexical) over dynamic variable scope. It was also one of the first programming languages to support first-class continuations.
Running Examples
Some examples from this site require particular versions of Scheme, or libraries, to run.
- R7RS programs typically begin with a line such as (import (scheme base) ...)
- R6RS programs with a line such as (import (rnrs) ...)
- R5RS programs don't require any preamble.
A semi-standard set of libraries for Scheme is the collection SRFIs (from Scheme Requests For Implementation). These libraries provide additional functions operating on core data structures, such as SRFI-1 for lists and SRFI-13 for strings; additional data structures, such as SRFI-69 or SRFI-125 for hash tables; or additional functionality, such as SRFI-42 providing eager comprehensions. Example programs which require one or more SRFIs must be run on implementations which support that SRFI.
Scheme does not directly support a GUI library: some examples use PsTk.
Citations
Tasks
- 100 doors
- 15 Puzzle Game
- 24 game
- 24 game/Solve
- 4-rings or 4-squares puzzle
- 9 billion names of God the integer
- A+B
- ABC Problem
- AKS test for primes
- Abundant, deficient and perfect number classifications
- Accumulator factory
- Ackermann function
- Align columns
- Amicable pairs
- Anagrams
- Anagrams/Deranged anagrams
- Animate a pendulum
- Anonymous recursion
- Apply a callback to an array
- Arbitrary-precision integers (included)
- Archimedean spiral
- Arithmetic evaluation
- Arithmetic-geometric mean
- Arithmetic/Complex
- Arithmetic/Integer
- Arithmetic/Rational
- Array concatenation
- Array length
- Arrays
- Assertions
- Associative array/Creation
- Associative array/Iteration
- Average loop length
- Averages/Arithmetic mean
- Averages/Mean angle
- Averages/Mean time of day
- Averages/Median
- Averages/Mode
- Averages/Pythagorean means
- Averages/Root mean square
- Averages/Simple moving average
- Babbage problem
- Balanced brackets
- Barnsley fern
- Best shuffle
- Binary digits
- Binary search
- Bitmap
- Bitmap/Write a PPM file
- Bitwise operations
- Boolean values
- Brace expansion
- Brownian tree
- Bulls and cows
- Caesar cipher
- Case-sensitivity of identifiers
- Catalan numbers
- Catamorphism
- Character codes
- Check that file exists
- Circles of given radius through two points
- Classes
- Closures/Value capture
- Collections
- Combinations
- Combinations and permutations
- Combinations with repetitions
- Comma quibbling
- Command-line arguments
- Comments
- Compare a list of strings
- Compiler/AST interpreter
- Compiler/code generator
- Compiler/lexical analyzer
- Compiler/syntax analyzer
- Compiler/virtual machine interpreter
- Compound data type
- Concurrent computing
- Conditional structures
- Continued fraction
- Convert seconds to compound duration
- Copy a string
- Count in factors
- Count in octal
- Count occurrences of a substring
- Count the coins
- Create a file
- Create a two-dimensional array at runtime
- Create an HTML table
- Cumulative standard deviation
- DNS query
- Date format
- Day of the week
- Deepcopy
- Delete a file
- Determine if a string is numeric
- Dot product
- Draw a clock
- Dynamic variable names
- Echo server
- Elementary cellular automaton
- Elementary cellular automaton/Random Number Generator
- Empty program
- Empty string
- Entropy
- Enumerations
- Ethiopian multiplication
- Evaluate binomial coefficients
- Even or odd
- Evolutionary algorithm
- Exceptions
- Execute Brainfuck
- Execute a Markov algorithm
- Execute a system command
- Exponentiation operator
- Extend your language
- Extreme floating point values
- FASTA format
- Factorial
- Factors of a Mersenne number
- Factors of an integer
- Farey sequence
- Fibonacci n-step number sequences
- Fibonacci sequence
- Fibonacci word
- Filter
- Find limit of recursion
- Find palindromic numbers in both binary and ternary bases
- First-class functions
- First-class functions/Use numbers analogously
- FizzBuzz
- Flatten a list
- Formal power series
- Formatted numeric output
- Forward difference
- Four bit adder
- Fractal tree
- Fractran
- Function composition
- Function definition
- Gamma function
- Generate Chess960 starting position
- Generate lower case ASCII alphabet
- Generator/Exponential
- Generic swap
- Greatest common divisor
- Greatest element of a list
- Greatest subsequential sum
- Guess the number
- Guess the number/With feedback
- Guess the number/With feedback (player)
- HTTP
- Hailstone sequence
- Hamming numbers
- Happy numbers
- Harshad or Niven series
- Hash from two arrays
- Hash join
- Haversine formula
- Hello world!
- Hello world/Graphical
- Hello world/Line printer
- Hello world/Newline omission
- Hello world/Standard error
- Hello world/Text
- Higher-order functions
- Hofstadter Q sequence
- Hofstadter-Conway $10,000 sequence
- Holidays related to Easter
- Horner's rule for polynomial evaluation
- Host introspection
- Hostname
- Huffman coding
- Identity matrix
- Increment a numerical string
- Infinity
- Integer comparison
- Integer roots
- Integer sequence
- Interactive programming
- JSON
- Jensen's Device
- K-means++ clustering
- Kaprekar numbers
- Knight's tour
- Knuth shuffle
- Knuth's power tree
- LZW compression
- Largest int from concatenated ints
- Leap year
- Least common multiple
- Left factorials
- Letter frequency
- Levenshtein distance
- Linear congruential generator
- List comprehensions
- Literals/Floating point
- Literals/Integer
- Literals/String
- Logical operations
- Long multiplication
- Longest common subsequence
- Longest increasing subsequence
- Loop over multiple arrays simultaneously
- Loops/Break
- Loops/Continue
- Loops/Do-while
- Loops/Downward for
- Loops/For
- Loops/For with a specified step
- Loops/Foreach
- Loops/Infinite
- Loops/N plus one half
- Loops/Nested
- Loops/While
- Lucas-Lehmer test
- Luhn test of credit card numbers
- Man or boy test
- Mandelbrot set
- Matrix multiplication
- Matrix transposition
- Matrix-exponentiation operator
- Miller–Rabin primality test
- Modular exponentiation
- Modulinos
- Monty Hall problem
- Multifactorial
- Multiline shebang
- Multiple distinct objects
- Multiplication tables
- Multisplit
- Mutual recursion
- N-queens problem
- Named parameters
- Natural sorting
- Nested function
- Non-continuous subsequences
- Non-decimal radices/Input
- Non-decimal radices/Output
- Nth root
- Null object
- Number reversal game
- Numerical integration
- Odd word problem
- One-dimensional cellular automata
- Operator precedence
- Order two numerical lists
- Ordered words
- Palindrome detection
- Pascal's triangle
- Perceptron
- Perfect numbers
- Permutations
- Pi
- Playing cards
- Power set
- Primality by trial division
- Prime decomposition
- Probabilistic choice
- Program name
- Program termination
- Pythagorean triples
- Queue/Definition
- Quine
- Random numbers
- Range expansion
- Range extraction
- Read a file line by line
- Real constants and functions
- Reduced row echelon form
- Remove duplicate elements
- Rename a file
- Repeat
- Repeat a string
- Return multiple values
- Reverse a string
- Reverse words in a string
- Roman numerals/Decode
- Roman numerals/Encode
- Roots of a quadratic function
- Roots of unity
- Rot-13
- Run-length encoding
- Runtime evaluation
- Runtime evaluation/In an environment
- S-Expressions
- SHA-1
- Same Fringe
- Search a list
- Search a list of records
- Set
- Shell one-liner
- Short-circuit evaluation
- Sierpinski carpet
- Sierpinski triangle
- Sieve of Eratosthenes
- Singly-linked list/Element definition
- Singly-linked list/Element insertion
- Singly-linked list/Traversal
- Sleep
- Sockets
- Sort an integer array
- Sort disjoint sublist
- Sort using a custom comparator
- Sorting algorithms/Bubble sort
- Sorting algorithms/Gnome sort
- Sorting algorithms/Heapsort
- Sorting algorithms/Insertion sort
- Sorting algorithms/Merge sort
- Sorting algorithms/Permutation sort
- Sorting algorithms/Quicksort
- Sorting algorithms/Tree sort on a linked list
- Soundex
- Stack
- Stair-climbing puzzle
- String case
- String comparison
- String concatenation
- String length
- Strip a set of characters from a string
- Strip comments from a string
- Substring
- Sum and Product Puzzle
- Sum and product of an array
- Sum digits of an integer
- Sum multiples of 3 and 5
- Sum of a series
- Sum of squares
- Symmetric difference
- System time
- Table creation/Postal addresses
- Take notes on the command line
- Taxicab numbers
- Temperature conversion
- Test a function
- Test integerness
- Time a function
- Tokenize a string
- Top rank per group
- Trigonometric functions
- Variadic function
- Vector products
- Walk a directory/Recursively
- Water collected between towers
- Web scraping
- Window creation
- Word wrap
- Y combinator
- Zeckendorf number representation
- Zero to the zero power