Name | Type | Description |
absvector | _ | Given a non-negative integer returns a vector in the native platform. |
absvector? | A --> boolean | Recognisor for native vectors. |
address-> | _ | Given an absolute vector A, a positive integer i
and a value V places V in the A[i]th position. |
<-address | _ | Given an absolute vector A, a positive integer i
retrieves V from the A[i]th position. |
adjoin | A --> (list A) --> (list A) | Conses an object to a list
if it is not already an element. |
and | boolean --> boolean --> boolean | Boolean and. |
append | (list A) --> (list A) --> (list A) | Appends two lists into one list.
Treated as polyadic. by the reader. |
arity | A --> number | Given a symbol, returns the arity of the function it designates
otherwise -1. |
atom? | A --> boolean | Recognisor for atoms, i.e. symbols, strings, numbers, booleans
and the empty list. |
boolean? | A --> boolean | Recognisor for booleans. |
bootstrap | string --> string | Given a filename to a Shen file pipes the Kλ code
from the Shen code; returns the filename with a kl extension. |
bound? | symbol --> boolean | Returns true if the variable is globally bound. |
call | _ | A unary higher-order Prolog predicate that calls its argument. |
cd | string --> string | Changes the home directory. (cd "Prog") causes
(load "hello_world.txt") to load Prog/hello_world.txt.
(cd "") is the default. |
char-stinput? | (stream in) --> boolean | Returns true if the input
is a character stream. |
char-stoutput? | (stream out) --> boolean | Returns true if the input
is a character stream. |
close | (stream A) --> (list B) | Closes a stream returning the empty list. |
cn | string --> string --> string | Concatenates two strings. |
compile | (A ==> B) --> A --> B | Applies a Shen YACC function to an input. |
concat | _ | Concatenates two symbols or booleans. |
cons | _ | A special form that takes an object e of type A
and a list l of type (list A) and produces a list of
type (list A) by adding e to the front of l. |
cons? | A --> boolean | Returns true iff the input is a non-empty list. |
declare | _ | Takes a function name f and a type t expressed as a list and gives f the type t. |
destroy | symbol --> symbol | Receives the name of a function
and removes its type from the environment. |
difference | (list A) --> (list A) --> (list A) | Subtracts the elements of the second list
from the first. |
do | A --> B --> B | Returns its last argument; polyadic courtesy of the reader. |
element? | A --> (list A) --> boolean | Returns true iff the first input is an element in the second. |
empty? | A --> boolean | Returns true iff the input is [ ]. |
enable-type-theory | symbol --> boolean | Takes + or - and enables/disables the Shen type system. |
error | _ | A special form: takes a string followed by n (n --> 0) expressions. Prints error string. |
error-to-string | exception --> string | Maps an error message to the corresponding string. |
eval | _ | Evaluates the input. |
eval-kl | _ | Evaluates the input as a Kλ expression. |
explode | A --> (list string) | Explodes an object to a list of strings. |
external | symbol --> (list symbol) | Given a package name, returns the list of symbols external to that
package. |
factorise | symbol --> boolean | Takes + or - and enables/dsiables code factorisation. |
fail | --> symbol | Returns the failure object – a symbol internal to the Shen package printed as .... |
fix | (A --> A) --> (A --> A) | Applies a function to generate a fixpoint. |
freeze | A --> (lazy A) | Returns a frozen version of its input. |
fresh | _ | Generates a print vector which is printed as a unique integer
prefaced by &&t. This is used to generate arbitrary terms in type checking. |
fst | (A * B) --> A | Returns the first element of a tuple. |
gensym | symbol --> symbol | Generates a fresh symbol or variable from a symbol. |
get-time | symbol --> number | For the argument run or real returns a number
representing the real or run time elapsed since the
last call. One of these options must be supported.
For the argument unix returns the Unix time. |
get | _ | Takes a symbol S, a pointer P and optionally a vector V
and returns the value in V pointed by P from S (if one exists)
or an error otherwise. If V is omitted the global property vector is used. |
hash | A --> number --> number | Returns a hashing of the first argument subject
to the restriction that the encoding must not be greater
than the second argument. |
head | (list A) --> A | Returns the first element of a list;
if the list is empty returns an error. |
hd | _ | Returns the first element of a list; for [] the result is platform dependent. |
hdstr | string --> string | Returns the first element of a string. |
hdv | (vector A) --> A | Returns the first element of a standard vector. |
if | boolean --> A --> A --> A | Takes a boolean b and two expressions x and y
and evaluates x if b evaluates to true
and evaluates y if b evaluates to false. |
implementation | --> string | Returns a string denoting the implementation
on which Shen is running. |
include | (list symbol) --> (list symbol) | Includes the datatype theories or synonyms for use in type
checking. |
include-all-but | (list symbol) --> (list symbol) | Includes all loaded datatype theories and synonyms
for use in type checking apart from those entered. |
inferences | --> number | Returns the number of logical inferences executed
since the last call to the top level. |
in-package | symbol --> symbol | Places the top level inside the package
denoted by the input and returns the input. |
input | _ | 0-place function. Takes a user input i and returns the normal form of i. |
input+ | _ | Special form. Takes inputs of the form .
If is not specified then defaults to standard input.
d() is the type denoted by the choice of expression
(e.g. ‘number’ denotes the type number). Takes a user input i
and returns the normal form of i given i is of the type d(). |
integer? | A --> boolean | Recognisor for integers. |
intern | _ | Maps a string to a symbol. |