Scheme

1 program Added 2025-10-22T09:38:52Z Model: openai/gpt-4o-miniTemp: 0.4 Evidence Report issue View issues
Aliases: Racket, Lisp, SICP
Provenance: commit 3dac7ed90c · authored 2025-10-22T11:38:52+02:00 · model openai/gpt-4o-mini

Sources mentioning this language

8 sources · pl_id: pl/scheme
LLM (this repo) · 1PldbLinguistPygmentsWikipediaHyperpolyglotRosettacodeWikidata · Q187560

Wikipedia infobox

Pulled from the wikimedia/structured-wikipedia snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and pl_fact.csv for the long-table provenance.

Paradigmsmulti-paradigm: functional · imperative · meta
Typingdynamic, latent, strong
Designed byGuy L. Steele Gerald Jay Sussman
First appeared1975
Influenced byALGOL · Lisp · MDL
Homepagehttps://www.scheme.org/

Extensions claimed by this language

10 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.scmlinguistprimary1.7M files
.scmpygmentsprimary1.7M files
.scmwikidataprimary1.7M files
.sswikidataprimary434.9K files
.schlinguistsecondary1.1M files
.sldlinguistsecondary440.2K files
.slslinguistsecondary584.5K files
.spslinguistsecondary30.3K files
.sslinguistsecondary434.9K files
.sspygmentssecondary434.9K files

Related languages

Racket (0.31)s7 (0.24)SCM (0.24)S-1 Lisp (0.23)Spice Lisp (0.23)

LLM-contributed programs

Simple Scheme Interpreter

Provenance: commit 3dac7ed90c · authored 2025-10-22T11:38:52+02:00 · model openai/gpt-4o-mini · Temp 0.4
code.scm · license: MIT · added: 2025-10-22T09:38:52Z
(define (eval expr)
  (cond ((number? expr) expr)
        ((symbol? expr) (lookup expr))
        ((list? expr)
         (let ((op (car expr))
               (args (cdr expr)))
           (case op
             ((+) (apply + (map eval args)))
             ((-) (apply - (map eval args)))
             ((*) (apply * (map eval args)))
             ((/) (apply / (map eval args)))
             (else (error "Unknown operator")))))))

(define (lookup sym)
  (if (assoc sym env)
      (cdr (assoc sym env))
      (error "Unbound variable")))

(define env '((x . 10) (y . 20)))

(eval '(+ x y))

Real programs from Software Heritage

1 sample mined from derived_datasets/<date>/contents/*.parquet, byte-verified against the SWH archive. Citation-grade qualified SWHIDs preserved.
RH_age_period_BR.sps · 1619 B · ext .sps · seen 7× in SWH
via fallback
swh:1:cnt:a384eed9729567aee7b66bdfff4986ee4975e474;origin=https://github.com/DHSProgram/DHS-Indicators-SPSS;anchor=swh:1:rev:582c6106aa969544202b4d415f5bc7f6f0673d30;path=/Chap09_RH/RH_age_period_BR.sps
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
* Encoding: windows-1252.
*****************************************************************************************************
 * Program: 			RH_age_period_BR.sps
 * Purpose: 			compute the age variable and set the period for the analysis
 * Author:			Shireen Assaf and translated to SPSS by Ivana Bjelic
 * Date last modified: 07/16/2019 by Ivana Bjelic

 * Notes: 				Choose reference period to select last 2 years or last 5 years
 					Using the a period of the last 2 years will not match final report but would provide more recent information.
 * 					The PNC indicator is always reported for the last 2 years before the survey. Therefore, 
					the period for this indicator was set as 24 in the PNC do files.
*****************************************************************************************************.

* choose reference period, last 2 years or last 5 years.
*compute period = 24.
compute period = 60.

** To check if survey has b19. If variable doesnt exist, empty variable is created.
begin program.
import spss, spssaux
varList = "b19"
createList = set(varList.split())
allvars = set(spssaux.VariableDict().variables)
undefined = createList - allvars
if undefined:
  cmd = "numeric " + " ".join(undefined)
  spss.Submit(cmd)
end program.

execute.

aggregate
  /outfile = * mode=addvariables
  /break=
  /b19_included=mean(b19).
recode b19_included (lo thru hi = 1)(else = 0).

***************************

* BR file variables.
* if b19 is present and not empty.
do if  b19_included = 1.
    compute age = b19.
else.
** if b19 is not present, compute age.
    compute age = v008 - b3.
end if.




Disambiguation rules

Linguist heuristic rules that predict this language when one of its claimed extensions is shared with another.
RuleExtKindPredicates (truncated)
h/linguist/.scm/1.scmpredicates[{"kind": "any", "regexes": ["(?:'[\\(\\*#]|\\w->\\w|\\.\\.\\.[\\s\\)]|\\([+\\-:<>\\/=~\\)]|~>|[#`]\\(|#:\\w)", "^\\s*\\((?:define\\*?|import|library|lambda)"]}, {"kind": "not_any", "regexes": ["\\(#[

Contribute — propose a file extension

Tell us where to find evidence about Scheme (mapped to pl/scheme). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Scheme/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Schematron Scheme 48 →