SketchyLISP Reference Manual - Copyright (C) 2005 Nils M Holm

6 Library Functions

6.1 Type Predicates

boolean? Check whether an expression X is a truth value. R5RS
list? Check if an expression is a (proper) list. R5RS
natural? Test whether a number is a natural number. Core

6.2 List Functions

append Append lists. R5RS
assoc Retrieve a binding from an association list. R5RS
assq Retrieve a binding from an association list. 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
equal? Compare two S-expressions. R5RS
iterate Iterate through a list. Core
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 N lists to one using an N-ary function F. R5RS
member Check whether a list has a member that is equal to a given S-expression. R5RS
memq Check whether a list has a member that is identical to a given symbol. R5RS
reverse Reverse the order of members of a list. R5RS

6.3 Logic and Combinatoric Functions

id Express identity. Core
logand Logical product (AND). Core
logeqv Logical equivalence (EQV). Core
lognand Logical negative product (NAND). Core
logneqv Logical negative equivalence (XOR). Core
lognor Logical negative sum (NOR). Core
lognot Logical negation (NOT). Core
logor Logical sum (OR). Core
not Logical negation (NOT). R5RS

6.4 Numeric Functions

* Multiply numbers. R5RS
+ Add numbers. R5RS
- Subtract numbers. R5RS
< Check whether two or more numbers are in ascending order. R5RS
<= Check whether two or more numbers are in non-ascending order. R5RS
= Check whether two or more numbers are equal. R5RS
> Check whether two or more numbers are in descending order. R5RS
>= Check whether two or more 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 result of the form (quotient remainder). Core
even? Test a number N for being even (N modulo 2 = 0) R5RS
expt Compute the X raised to the power of Y. R5RS
gcd Compute the greatest common divisor (GCD) of two integer numbers. R5RS
integer Convert a natural or integer number to an integer. Core
lcm Compute the least common multiple (LCM) of two integer 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 if 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 if 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 result of the form (quotient remainder). Core
negate Compute the negative value of a number. Core
negative? Check whether a number is negative. R5RS
nexpt Compute the X raised to the power of Y. Core
non-negative? Check whether a number is positive or zero. Core
normalize Normalize a number by removing leading zeroes and plus signs. Core
nqoutient Divide two natural numbers. Core
nremainder Compute the remainder of the division of two natural numbers. Core
odd? Test a number N for being odd (N modulo 2 = 1). R5RS
positive? Check whether a number is positive. R5RS
pred Find the predecessor of a decimal digit. Core
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
succ Find the successor of a decimal digit. Core
zero? Test a number for being zero. R5RS

6.5 Char Functions

char-alphabetic? Test whether a char is alphabetic. R5RS
char-ci=? Case-insensitively test whether two chars are equal. R5RS
char-ci>=? Case-insensitively test whether two chars are in lexically non-ascending order. 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-descending order. R5RS
char-ci<? Case-insensitively test whether two chars are in lexically 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 equal. R5RS
char>=? Test whether two chars are in lexically non-ascending order. R5RS
char>? Test whether two chars are in lexically descending order. R5RS
char<=? Test whether two chars are in lexically non-descending order. R5RS
char<? Test whether two chars are in lexically ascending order. R5RS

6.6 String Functions

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 equal. R5RS
string-ci>=? Case-insensitively test whether two strings are in lexically non-ascending order. 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-descending order. R5RS
string-ci<? Case-insensitively test whether two strings are in lexically 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 equal. R5RS
string>=? Test whether two strings are in non-ascending lexical order. R5RS
string>? Test whether two strings are in descending lexical order. R5RS
string<=? Test whether two strings are in non-descending lexical order. R5RS
string<? Test whether two strings are in ascending lexical order. R5RS
substring Extract a substring. R5RS

6.7 Library Loaders

sketchy Load the SketchyLISP core library into memory. Core