1. Home
  2. /
  3. Scheme
  4. /
  5. List Sum

List Sum - Scheme Typing CST Test

Loading…

List Sum — Scheme Code

Sums elements of a list recursively.

(define (sum-list lst)
  (if (null? lst) 0
      (+ (car lst) (sum-list (cdr lst)))))
(display (sum-list '(1 2 3 4 5))) (newline)

Scheme Language Guide

Scheme is a minimalist, functional programming language in the Lisp family, emphasizing recursion, first-class functions, and symbolic computation. It is widely used in education, research, and AI for its simplicity and powerful abstraction capabilities.

Primary Use Cases

  • ▸Functional programming education
  • ▸Symbolic computation and AI
  • ▸DSL (domain-specific language) design
  • ▸Prototyping algorithms
  • ▸Scripting within research software
  • ▸Teaching recursion and higher-order functions

Notable Features

  • ▸Minimalist syntax and semantics
  • ▸First-class functions and closures
  • ▸Tail-call optimization
  • ▸Powerful macro system
  • ▸Lexical scoping and recursion

Origin & Creator

Scheme was developed in the 1970s by Guy L. Steele and Gerald Jay Sussman at MIT as a simplified, cleaner dialect of Lisp.

Industrial Note

Scheme is primarily used in academia, language design research, AI prototyping, symbolic mathematics, and educational platforms like introductory computer science courses.

More Scheme Typing Exercises

Scheme Counter and Theme ToggleScheme Simple AdditionScheme FactorialScheme Fibonacci SequenceScheme Max of Two NumbersScheme Even Numbers FilterScheme Conditional Counter IncrementScheme Resettable CounterScheme Theme Toggle Only

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher