Simply Scheme: Alphabetical Table of Scheme Primitives Simply Scheme: Introducing Computer Science 2/e Copyright (C) 1999 MIT

Alphabetical Table of Scheme Primitives

cover photo
Brian Harvey
University of California, Berkeley
Matthew Wright
University of California, Santa Barbara

Download PDF version
Back to Table of Contents
BACK chapter thread NEXT
MIT Press web page for Simply Scheme

This table does not represent the complete Scheme language. It includes the nonstandard Scheme primitives that we use in this book, and it omits many standard ones that are not needed here.

' Abbreviation for (quote).
*Multiply numbers.
+Add numbers.
-Subtract numbers.
/Divide numbers.
<Is the first argument less than the second?
<=Is the first argument less than or equal to the second?
=Are two numbers equal? (Like equal? but works only for numbers).
>Is the first argument greater than the second?
>=Is the first argument greater than or equal to the second?
absReturn the absolute value of the argument.
accumulateApply a combining function to all elements (see here).
alignReturn a string spaced to a given width (see here).
and(Special form) Are all of the arguments true values (i.e., not #f)?
appearancesReturn the number of times the first argument is in the second.
appendReturn a list containing the elements of the argument lists.
applyApply a function to the arguments in a list.
assocReturn association list entry matching key.
before?Does the first argument come alphabetically before the second?
begin(Special form) Carry out a sequence of instructions (see here).
bfAbbreviation for butfirst.
blAbbreviation for butlast.
boolean?Return true if the argument is #t or #f.
butfirstReturn all but the first letter of a word, or word of a sentence.
butlastReturn all but the last letter of a word, or word of a sentence.
c...rCombinations of car and cdr (see here).
carReturn the first element of a list.
cdrReturn all but the first element of a list.
ceilingRound a number up to the nearest integer.
childrenReturn a list of the children of a tree node.
close-all-portsClose all open input and output ports.
close-input-portClose an input port.
close-output-portClose an output port.
cond(Special form) Choose among several alternatives (see here).
consPrepend an element to a list.
cosReturn the cosine of a number (from trigonometry).
countReturn the number of letters in a word or number of words in a sentence.
datumReturn the datum of a tree node.
define(Special form) Create a global name (for a procedure or other value).
displayPrint the argument without starting a new line.
empty?Is the argument empty, i.e., the empty word "" or the empty sentence ()?
eof-object?Is the argument an end-of-file object?
equal?Are the two arguments the same thing?
errorPrint an error message and return to the Scheme prompt.
even?Is the argument an even integer?
everyApply a function to each element of a word or sentence (see here).
exptRaise the first argument to the power of the second.
filterSelect a subset of a list (see here).
firstReturn first letter of a word, or first word of a sentence.
floorRound a number down to the nearest integer.
for-eachPerform a computation for each element of a list.
if(Special form) Choose between two alternatives (see here).
integer?Is the argument an integer?
itemReturn the $n$th letter of a word, or $n$th word of a sentence.
keepSelect a subset of a word or sentence (see here).
lambda(Special form) Create a new procedure (see Chapter \lambchop).
lastReturn last letter of a word, or last word of a sentence.
lengthReturn the number of elements in a list.
let(Special form) Give temporary names to values (see here).
listReturn a list containing the arguments.
list->vectorReturn a vector with the same elements as the list.
list-refSelect an element from a list (counting from zero).
list?Is the argument a list?
loadRead a program file into Scheme.
logReturn the logarithm of a number.
make-nodeCreate a new node of a tree.
make-vectorCreate a new vector of the given length.
mapApply a function to each element of a list (see here).
maxReturn the largest of the arguments.
memberReturn subset of a list starting with selected element, or #f.
member?Is the first argument an element of the second? (see here).
minReturn the smallest of the arguments.
newlineGo to a new line of printing.
notReturn #t if argument is #f; return #f otherwise.
null?Is the argument the empty list?
number?Is the argument a number?
odd?Is the argument an odd integer?
open-input-fileOpen a file for reading, return a port.
open-output-fileOpen a file for writing, return a port.
or(Special form) Are any of the arguments true values (i.e., not #f)?
procedure?Is the argument a procedure?
quote(Special form) Return the argument, unevaluated (see here).
quotientDivide numbers, but round down to integer.
randomReturn a random number ≥ 0 and smaller than the argument.
readRead an expression from the keyboard (or a file).
read-lineRead a line from the keyboard (or a file), returning a sentence.
read-stringRead a line from the keyboard (or a file), returning a string.
reduceApply a combining function to all elements of list (see here).
remainderReturn the remainder from dividing the first number by the second.
repeatedReturn the function described by f(f(⋅⋅⋅(f(x)))) (see here).
roundRound a number to the nearest integer.
seAbbreviation for sentence.
sentenceJoin the arguments together into a big sentence.
sentence?Is the argument a sentence?
showPrint the argument and start a new line.
show-lineShow the argument sentence without surrounding parentheses.
sinReturn the sine of a number (from trigonometry).
sqrtReturn the square root of a number.
squareNot a primitive! (define (square x) (* x x))
traceReport on all future invocations of a procedure.
untraceUndo the effect of trace.
vectorCreate a vector with the arguments as elements.
vector->listReturn a list with the same elements as the vector.
vector-lengthReturn the number of elements in a vector.
vector-refReturn an element of a vector (counting from zero).
vector-set!Replace an element in a vector.
vector?Is the argument a vector?
vowel?Not a primitive! (define (vowel? x) (member? x '(a e i o u)))
wordJoins words into one big word.
word?Is the argument a word? (Note: numbers are words.)
writePrint the argument in machine-readable form (see here).


(back to Table of Contents)

BACK chapter thread NEXT

Brian Harvey, bh@cs.berkeley.edu