t3x.org / sketchy / sk06.html
SketchyLISP
Reference
  Copyright (C) 2007
Nils M Holm

6 Library Procedures

6.1 General Predicates

boolean? Check whether a datum is a truth value. R5RS
equal? Compare forms. R5RS
eqv? Compare atoms. R5RS
integer? Test whether a number is an integer number. R5RS
list? Check whether a form is a (proper) list. R5RS
natural? Test whether a number is a natural number. Core
not-equal? Compare forms with negative result. Ext.
ordered? Impose a total ordering on a list. Ext.
predicate-iterator Turn a binary predicate into a variadic predicate. Core

6.2 List Procedures

append Append lists. R5RS
assoc Retrieve an association from an associaton list; the key is a form. R5RS
assp Retrieve an association from an associaton list; the key is a a predicate. R5.91RS
assq Retrieve an association from an associaton list; the key is a symbol. R5RS
assv Retrieve an association from associaton list; the key is an atom. R5RS
caaaar ... cddddr Access elements of nested lists. R5RS
caaar ... cdddr Access elements of nested lists. R5RS
caar ... cddr Access elements of nested lists. R5RS
count Count members of nested lists. Ext.
depth Compute the depth of a list. Ext.
exists Check whether a given property exists in a sequence of lists. R5.91RS
explode Explode a symbol to a list of symbols. Ext.
filter Extract members from lists. R5.91RS
fold-left Fold lists to values, left-associative version. R5.91RS
fold-right Fold lists to values, right-associative version. R5.91RS
for-all Check whether all lists of a sequence have a given property. R5.91RS
head? Check whether a list is a head of another list. Ext.
implode Implode a list of symbols to a symbol. Ext.
last Extract the last member of a list. Ext.
length Compute the length of a list. R5RS
list Create a list from arguments. R5RS
list-ref Extract the n'th member of a list. R5RS
list-tail Extract the tail of a list beginning at the n'th member of that list. R5RS
map Map a function over lists. R5RS
map-car Map a unary function over a list. Core
map-cdr Map a unary function over all tails of a list. Ext.
member Find the first member of a list that is equal to a given datum. R5RS
memp Find the first member of a list that satisfies a given predicate. R5.91RS
memq Find the first member of a list that is identical to a given symbol. R5RS
memv Find the first member of a list that is equivalent to a given atom. R5RS
pair Map two lists to an association list. Ext.
qsort Sort a list. Ext.
remove Remove forms from a list. R5.91RS
remp Remove forms satisfying a predicate from a list. R5.91RS
remq Remove symbols from a list. R5.91RS
remv Remove atoms from a list. R5.91RS
replace Replace forms in forms. Ext.
reverse Reverse a list. R5RS
substitute Substitute values for variables. Ext.
tail? Check whether a list is a tail of another list. Ext.

6.3 Logic and Combinatoric Procedures

factorial Compute the factorial of a number. Ext.
id Express identity. Ext.
intersection Compute the intersection of sets. Ext.
iota Create a sequence of numbers. Ext.
not Logical negation. R5RS
permute Create permutations of a list. Ext.
product Compute the product of a sequence of numbers. Ext.
sum Compute the sum of a sequence of numbers. Ext.
union Compute the union of sets. Ext.
unique Remove duplicates from a list (turn it into a set). Ext.

6.4 Numeric Procedures

* Multiply numbers. R5RS
+ Add numbers. R5RS
- Subtract numbers. R5RS
< Check whether numbers are in ascending order. R5RS
<= Check whether numbers are in non-ascending order. R5RS
= Check whether numbers are equal. R5RS
> Check whether numbers are in descending order. R5RS
>= Check whether numbers are in non-ascending order. R5RS
abs Compute the absolute value of a number. R5RS
digits Constants for representing decimal digits. Core
divide Divide two numbers, giving a quotient and a remainder. Core
even? Test a number for being even R5RS
expt Raise a number to a power. R5RS
gcd Compute the greatest common divisor of a seqeunce of numbers. R5RS
integer Convert a natural or integer number to an integer. Core
lcm Compute the least common multiple of a seqeunce of numbers. R5RS
max Find the maximum of a list of numbers. R5RS
min Find the minimum of a list of numbers. R5RS
modulo Compute the modulo of two numbers. R5RS
n* Compute the product of two natural numbers. Core
n+ Add two natural numbers. Core
n- Subtract two natural numbers. Core
n< Check whether two natural numbers are in ascending order. Core
n<= Check whether two natural numbers are in non-descending order. Core
n> Check whether two natural numbers are in descending order. Core
n>= Check whether two natural numbers are in non-ascending order. Core
natural Convert an integer or natural number to a natural number. Core
ndivide Divide two natural numbers, giving a quotient and a remainder. Core
negate Compute the negative value of a number. Core
negative? Check whether a number is negative. R5RS
nexpt Raise a natural number to a power. Core
non-negative? Check whether a number is positive or zero. Core
normalize Normalize a number. Core
nqoutient Divide two natural numbers. Core
nremainder Compute the remainder of the division of two natural numbers. Core
odd? Test a number for being odd. R5RS
positive? Check whether a number is positive. R5RS
quotient Divide two numbers, returning their integer quotient. R5RS
remainder Compute the remainder of the integer division of two numbers. R5RS
sqrt Compute the square root of a natural number. R5RS
zero? Test a number for being zero. R5RS

6.5 Char Procedures

char-alphabetic? Test whether a char is alphabetic. R5RS
char-ci<? Case-insensitively test whether two chars are in lexically ascending order. R5RS
char-ci<=? Case-insensitively test whether two chars are in lexically non-descending order. R5RS
char-ci=? Case-insensitively test whether two chars are equal. R5RS
char-ci>? Case-insensitively test whether two chars are in lexically descending order. R5RS
char-ci>=? Case-insensitively test whether two chars are in lexically non-ascending order. R5RS
char-downcase Convert a char to lower case. R5RS
char-lower-case? Test whether a char is a lower case character. R5RS
char-numeric? Test whether a char is numeric. R5RS
char-upcase Convert a char to upper case. R5RS
char-upper-case? Test whether a char is an upper case character. R5RS
char-whitespace? Test whether a char is white space. R5RS
char<? Test whether two chars are in lexically ascending order. R5RS
char<=? Test whether two chars are in lexically non-descending order. R5RS
char=? Test whether two chars are equal. R5RS
char>? Test whether two chars are in lexically descending order. R5RS
char>=? Test whether two chars are in lexically non-ascending order. R5RS

6.6 String Procedures

number->string Convert a number to a string. R5RS
string Create a string from arguments. R5RS
string->number Convert a string to a number. R5RS
string-append Append strings. R5RS
string-ci<? Case-insensitively test whether two strings are in lexically ascending order. R5RS
string-ci<=? Case-insensitively test whether two strings are in lexically non-descending order. R5RS
string-ci=? Case-insensitively test whether two strings are equal. R5RS
string-ci>? Case-insensitively test whether two strings are in lexically descending order. R5RS
string-ci>=? Case-insensitively test whether two strings are in lexically non-ascending order. R5RS
string-length Compute the length of a string. R5RS
string-ref Extract the n'th char of a string. R5RS
string<? Test whether two strings are in ascending lexical order. R5RS
string<=? Test whether two strings are in non-descending lexical order. R5RS
string=? Test whether two strings are equal. R5RS
string>? Test whether two strings are in descending lexical order. R5RS
string>=? Test whether two strings are in non-ascending lexical order. R5RS
substring Extract a substring. R5RS

6.7 Input/Output Procedures

newline Write a newline sequence to the output stream. R5RS
read-line Read a line of data and return it in a string. Ext.

6.8 Library Syntax

case Select cases. R5RS
if Evaluate expressions conditionally. R5RS
let* Bind values sequentially. R5RS