Prelude
This module is automatically imported. Contains standard ISLISP definitions, as well as core extensions such as importing / exporting.
*
function
(* x*) => <number>
Returns the product of its arguments. If all arguments are integers, the result is an integer. If any argument is a float, the result is a float. When given no arguments * returns 1. An error shall be signaled if any x is not a number (error-id. domain-error).
*most-negative-float*
constant
*most-negative-float* => <float>
The value of *most-positive-float* is the implementation-dependent floating-point number closest to negative infinity.
*most-positive-float*
constant
*most-positive-float* => <float>
The value of *most-positive-float* is the implementation-dependent floating-point number closest to positive infinity.
*stacktrace-formatter*
dynvar
*stacktrace-formatter* => <function>
The active function used to format condition’s stacktrace. Must be a function that accepts two arguments:
-
stream — a stream into which the result should be written to;
-
stacktrace — a vector of stacktrace elements, where each element itself is a vector of (in order): module name, line start, column start, line end, column end.
+
function
(+ x*) => <number>
Returns the sum of its arguments. If all arguments are integers, the result is an integer. If any argument is a float, the result is a float. When given no arguments, + returns 0. An error shall be signaled if any x is not a number (error-id. domain-error).
-
function
(- x+) => <number>
Given one argument, x, this function returns its additive inverse. An error shall be signaled if x is not a number (error-id. domain-error).
If an implementation supports a -0.0 that is distinct from 0.0, then (- 0.0) returns -0.0; in implementations where -0.0 and 0.0 are not distinct, (- 0.0) returns 0.0.
/=
function
(/= x1 x2) => boolean
Returns t if x1 and x2 have mathematically distinct values; otherwise, returns nil. An error shall be signaled if either x1 or x2 is not a number (error-id. domain-error).
<
function
(< x1 x2) => boolean
< returns t if x1 is less than x2.
The mathematical values of the arguments are compared. An error shall be signaled if either x1 or x2 is not a number (error-id. domain-error).
<=
function
(<= x1 x2) => boolean
⇐ returns t if x1 is less than or = x2.
The mathematical values of the arguments are compared. An error shall be signaled if either x1 or x2 is not a number (error-id. domain-error).
<arithmetic-error>
class
-
<error>
-
operation
-
operands
Base class of arithmetic error conditions.
The operation is the function that was being performed, and the operands is a list of the arguments it received.
<basic-array*>
class
Abstract
-
<basic-array>
All non-one-dimensional arrays are of the abstract class <basic-array*>, but (as with all abstract classes) there are no direct instances of this class. It is provided for type discrimination purposes only.
ISLISP defines only one direct subclass of <basic-array*>: <general-array*>. There may be additional, implementation-defined subclasses of <basic-array*>.
<basic-array>
class
Abstract
-
<object>
All arrays are of the abstract class <basic-arraya>, but (as with all abstract classes) there are no direct instances of this class. It is provided for type discrimination purposes only.
ISLISP defines two direct subclasses of <basic-array>: <basic-vector> and <basic-array*>. These classes are mutually exclusive and form an exhaustive partition of the set of basic-arrays. There shall be no other direct subclasses of <basic-array>.
<basic-vector>
class
Abstract
-
<basic-array>
All one-dimensional arrays are of the abstract class <basic-vector>, but (as with all abstract classes) there are no direct instances of this class. It is provided for type discrimination purposes only.
ISLISP defines only two direct subclasses of <basic-vector>: <general-vector> and <string>. There may be additional, implementation-defined subclasses of <basic-vector>.
<built-in-class>
class
-
<object>
The class <built-in-class> is the class whose instances are classes that have special implementations or restricted capabilities. For example, it is not possible to define subclasses of a built-in class.
<character>
class
-
<object>
Characters are represented as instances of the <character> class. This insulates the programmer from particular character codes.
<cons>
class
-
<list>
A cons (sometimes also called "dotted pair") consists of two components; the left component is called car and the right component is called cdr. The constructor of this class is cons.
<control-error>
class
-
<error>
Class of condition signalled when an attempt is made to leave a block more than once or when there is no outstanding catcher for a catch tag.
<division-by-zero>
class
-
<arithmetic-error>
Class of condition signalled when a divison by zero is attempted.
<domain-error>
class
-
<program-error>
Class of condition signalled when the object given as argument to a standard function for which an argument class restriction is in effect is not an instance of the class to which the argument is restricted.
<end-of-stream>
class
-
<stream-error>
Class of conditions raised when an attempt to read a character or byte at the end-of-stream when eos-error-p argument is true, or when an attempt to read a more complex object is about to begin (e.g., by read or read-line) but the end-of-stream is seen before parsing of that object has finished.
<error>
class
-
<serious-condition>
Class of conditions signalled when dynamically detecting a program error.
<float>
class
-
<number>
This class represents the set of floating-point numbers. Each floating-point number is represented by a rational number with some given precision; see IEEE standard 754-1985 for details.
<floating-point-overflow>
class
-
<arithmetic-error>
Class of condition signalled when an operation causes floating point overflow.
<floating-point-underflow>
class
-
<arithmetic-error>
Class of condition signalled when an operation causes floating point underflow.
<general-array*>
class
-
<basic-array*>
An object of class <general-array*> is a non-one-dimensional array that is capable of holding elements of type <object>. When the function create-array is asked to create an array of dimensionality other than 1, the resulting array is of this class.
<general-vector>
class
-
<basic-vector>
An object of class <general-vector> is a one-dimensional array that is capable of holding elements of type <object>. When the function create-array is asked to create a one-dimensional array, the resulting array is of this class.
<list>
class
-
<object>
The <list> class represents singly-linked sequence lists. It is partitioned into two subclasses <cons> and <null>.
<null>
class
-
<symbol>
-
<list>
This class consists of only one element, the object called nil. This object is the false value in boolean expressions.
<number>
class
-
<object>
The class number has the disjoint subclasses <float> and <integer>.
<parse-error>
class
-
<error>
-
string
-
expected-class
Class of condition signalled when failing to parse (e.g., calling parse-number).
The string is the string that was being parsed, and the expected-class is the class that the textual notation in the string was expected to represent.
<program-error>
class
-
<error>
Class of conditions signalled when attempting invalid operations, such as mutating immutable bindings, or accessing elements by index outside valid range.
<serious-condition>
class
-
<object>
When a problem situation is detected, a representation of that situation called a condition (or sometimes a "condition object" to emphasize its nature as an ordinary ISLISP object) is constructed and the situation represented by the condition is announced by a process called signaling. This signaling process allows a dynamically established handler an opportunity to resolve the problem.
<serious-condition> is the general superclass of condition objects.
<simple-error>
class
-
<error>
-
format-string
-
format-arguments
Generic error, usually raised using error or cerror functions.
The format-string (a string) and format-arguments (a list of objects) are passed through to format to construct the error message. Each object in the list given as format-arguments becomes a separate data argument, obj, in the call to format.
<standard-class>
class
-
<object>
Default class of classes (metaclass) defined by defclass.
<standard-generic-function>
class
-
<generic-function>
The default class of all generic functions.
<standard-object>
class
-
<object>
Instance of the class <standard-class> and is a superclass of every class that is an instance of <standard-class> except itself.
<storage-exhausted>
class
-
<serious-condition>
Class of conditions raised when requested allocation fails.
<stream-error>
class
-
<error>
-
stream
Class of condition raised when error is detected with state of input/output stream.
The stream is the stream on which the error occurred.
<string>
class
-
<basic-vector>
An object of class <string> is a one-dimensional array that is capable only of holding elements of type <character>. When the function create-string is used, the result is of this class.
<symbol>
class
-
<object>
A symbol (an instance of class <symbol>) is an object. Symbols can be named or unnamed. A symbol’s name is sometimes called a print name because it is used to identify the symbol during reading and printing. Symbols can have associated properties.
<unbound-variable>
class
-
<undefined-entity>
Class of condition signalled when an attempt is made to access an unbound variable.
<undefined-entity>
class
-
<program-error>
-
name
-
namespace
Class of condition signalled when the entity denoted by an identifier does not exist when an access to that entity is made.
The name is a symbol representing the identifier which was undefined. The namespace is one of the symbols variable, dynamic-variable, function, or class.
<undefined-function>
class
-
<undefined-entity>
Class of condition signalled when a function does not exist at its activation point.
=
function
(= x1 x2) => boolean
Returns t if x1 has the same mathematical value as x2; otherwise, returns nil. An error shall be signaled if either x1 or x2 is not a number (error-id. domain-error).
| = differs from eql because = compares only the mathematical values of its arguments, whereas eql also compares the representations. |
>
function
(> x1 x2) => boolean
> returns t if x1 is greater than x2.
The mathematical values of the arguments are compared. An error shall be signaled if either x1 or x2 is not a number (error-id. domain-error).
>=
function
(>= x1 x2) => boolean
>= returns t if x1 is greater than or = x2.
The mathematical values of the arguments are compared. An error shall be signaled if either x1 or x2 is not a number (error-id. domain-error).
abs
function
(abs x) => <number>
The function abs returns the absolute value of its argument. An error shall be signaled if x is not a number (error-id. domain-error).
and
syntax
(and form*) => <object>
and is the sequential logical "and" (or "∧"). forms are evaluated from left to right until either one of them evaluates to nil or else none are left. If one of them evaluates to nil, then nil is returned from the and; otherwise, the value of the last evaluated form is returned. The form and is equivalent to the following:
(and) = 't (and form) = form (and form1 form2 … formn) = (if form1 (and form2 … formn) 'nil)
append
function
(append list*) => <list>
Returns the result of appending all of the lists, or () if given no lists. An error shall be signaled if any list is not a list (error-id. domain-error).
This function does not modify its arguments. It is implementation defined whether and when the result shares structure with its list arguments.
An error shall be signaled if the list cannot be allocated (error-id. cannot-create-list).
apply
function
(apply function obj* list) => <object>
Applies function to the arguments, obj*, followed by the elements of list, if any. It returns the value returned by function.
An error shall be signaled if function is not a function (error-id. domain-error). Each obj may be any ISLISP object. An error shall be signaled if list is not a proper list (see §7) (error-id. improper-argument-list).
aref
function
(aref basic-array z*) => <object>
aref returns the object stored in the component of the basic-array specified by the sequence of integers z. This sequence must have exactly as many elements as there are dimensions in the basic-array, and each one must satisfy 0 ≤ zi < di , di the i_th dimension and 0 ≤ _i < d, d the number of dimensions. Arrays are indexed 0 based, so the i_th row is accessed via the index _i − 1.
An error shall be signaled if basic-array is not a basic-array (error-id. domain-error). An error shall be signaled if any z is not a non-negative integer (error-id. domain-error).
aref
setf
(setf (aref basic-array z*) obj) => <object>
Replaces the object obtainable by aref with obj. The returned value is obj. The constraints on the basic-array and the sequence of indices z is the same as for aref.
arithmetic-error-operands
function
(arithmetic-error-operands arithmetic-error) => <list>
This function returns the operands supplied as data when creating the arithmetic-error. An error shall be signaled if arithmetic-error is not a condition of class <arithmetic-error> (error-id. domain-error).
arithmetic-error-operation
function
(arithmetic-error-operation arithmetic-error) => <function>
This function returns the operation supplied as data when creating the arithmetic-error. An error shall be signaled if arithmetic-error is not a condition of class <arithmetic-error> (error-id. domain-error).
array-dimensions
function
(array-dimensions basic-array) => <list>
Returns a list of the dimensions of a given basic-array. An error shall be signaled if basic-array is not a basic-array (error-id. domain-error). The consequences are undefined if the returned list is modified.
assoc
function
(assoc obj association-list) => <list>
If assocation-list contains at least one cons whose car is obj (as determined by eql), the first such cons is returned. Otherwise, nil is returned. An error shall be signaled if association-list is not a list of conses (error-id. domain-error).
assure
syntax
(assure class-name form) => <object>
Evaluates form. If form returns, the returned value is returned by the assure form. In addition, this form specifies that the value of form is of the class specified by class-name (which must be the name of an existing class).
An error shall be signaled if the value of form is not of the class or a subclass of the class designated by class-name (error-id. domain-error).
atan
function
(atan x) => <number>
Returns the arc tangent of x.
The result is a (real) number that lies between −π/2 and π/2 (both exclusive).
The following definition for (one-argument) arc tangent determines the range and branch cuts:
An error shall be signaled if x is not a number (error-id. domain-error).
atan2
function
(atan2 x1 x2) => <number>
Given a point (x2, x1) in rectangular coordinates, this function returns the phase of its representation in polar coordinates. If x1 is zero and x2 is negative, the result is positive. If x1 and x2 are both zero, the result is implementation defined.
An error shall be signaled if x is not a number (error-id. domain-error).
The value of atan2 is always between −π (exclusive) and π (inclusive) when minus zero is not supported; when minus zero is supported, the range includes −π.
| y Condition | x Condition | Cartesian locus | Range of result |
|---|---|---|---|
y=0 |
x>0 |
Positive x-axis |
0 |
*y=+0 |
x>0 |
Positive x-axis |
+0 |
*y=-0 |
x>0 |
Positive x-axis |
-0 |
y>0 |
x>0 |
Quadrant I |
0<result<π/2 |
y>0 |
x=0 |
Positive y-axis |
π/2 |
y>0 |
x<0 |
Quadrant II |
π/2<result<π |
y=0 |
x<0 |
Negative x-asis |
π |
*y=+0 |
x<0 |
Negative x-asis |
π |
*y=-0 |
x<0 |
Negative x-asis |
-π |
y<0 |
x<0 |
Quadrand III |
-π<result←π/2 |
y<0 |
x=0 |
Negative y-axis |
-π/2 |
y<0 |
x>0 |
Quadrant IV |
-π/2<result<0 |
y=0 |
x=0 |
Origin |
implementation defined |
*y=+0 |
x=+0 |
Origin |
+0 |
*y=-0 |
x=+0 |
Origin |
-0 |
*y=+0 |
x=-0 |
Origin |
π |
*y=-0 |
x=-0 |
Origin |
-π |
The signs of x1 (indicated as y) and x2 (indicated as x) are used to derive quadrant information. Figure 19.1 details various special cases. The asterisk (*) indicates that the entry in the figure applies to implementations that support minus zero.
atanh
function
(atanh x) => <number>
Returns the hyperbolic arc tangent of x. An error shall be signaled if x is not a number with absolute value less than 1 (error-id. domain-error).
basic-array*-p
function
(basic-array*-p obj) => boolean
basic-array*-p returns t if obj is a basic-array* (instance of class <basic-array*>); otherwise, returns nil. obj may be any ISLISP object.
basic-array-p
function
(basic-array-p obj) => boolean
basic-array-p returns t if obj is a basic-array (instance of class <basic-array>); otherwise, returns nil. obj may be any ISLISP object.
basic-vector-p
function
(basic-vector-p obj) => boolean
basic-vector-p returns t if obj is a basic-vector (instance of class <basic-vector>); otherwise, returns nil. obj may be any ISLISP object.
block
syntax
(block name form*) => <object>
The block special form executes each form sequentially from left to right. If the last form exits normally, whatever it returns is returned by the block form.
The name in a block form is not evaluated; it must be an identifier. The scope of name is the body form*—only a return-from textually contained in some form can exit the block. The extent of name is dynamic.
If a return-from is executed, the result-form is evaluated. If this evaluation returns normally, the value it returns is immediately returned from the innermost lexically enclosing block form with the same name.
return-from is used to return from a block. name is not evaluated and must be an identifier. A block special form must lexically enclose the occurrence of return-from; the value produced by result-form is immediately returned from the block. The return-from form never returns and does not have a value.
An error shall be signaled if an attempt is made to exit a block after it has been exited (error-id. control-error); It is a violation if name is not an identifier. It is a violation if a block with a corresponding name does not exist. See §14.7.2 for other errors.
call-next-method
local-function
(call-next-method) => <object>
The call-next-method function can be used within the body of a method to call the next method.
It returns the value returned by the method it calls.
The type of method combination used determines which methods can invoke call-next-method and what is the next method to be called.
In the case of simple method combination where the method combination type is nil the next method is the next most specific method.
The standard method combination type allows call-next-method to be used within primary methods and :around methods. The standard method combination type defines the next method as specified in §15.3.3.2.
call-next-method passes the current method’s original arguments to the next method. Neither using setq nor rebinding variables with the same names as parameters of the method affects the values call-next-method passes to the method it calls. The call-next-method function returns the value returned by the method it calls. After call-next-method returns, further computation is possible. The next-method-p function can be used to test whether there is a next method.
The functional binding of call-next-method is lexical within the body of the method-defining form; i.e., it is as if it were established by labels. The function object to which the binding refers has indefinite extent.
An error shall be signaled if call-next-method is used in methods that do not support it. An error shall be signaled if call-next-method is executed and there is no next method.
car
function
(car cons) => <object>
The function car returns the left component of the cons. An error shall be signaled if cons is not a cons (error-id. domain-error).
car
setf
(setf (car cons) obj) => <object>
Updates the left component of cons with obj. The returned value is obj. An error shall be signaled if cons is not a cons (error-id. domain-error). obj may be any ISLISP object.
case
syntax
(case keyform ((key*) form*)* [(t form*)]) => <object>
The case and case-using special forms, called case forms, provide a mechanism to execute a matching clause from a series of clauses based on the value of a dispatching form keyform.
The clause to be executed is identified by a set of keys. A key can be any object. If the keylist of the last clause is t the associated clause is executed if no key matches the keyform.
keyform is a form to be computed at the beginning of execution of the case form. If the result of evaluating keyform is equivalent to a key, then the forms, if any, in the corresponding clause are evaluated sequentially and the value of the last one is returned as value of the whole case form. case determines match equivalence by using eql; case-using match determines equivalence by using the result of evaluating predform. predform must be a boolean or quasi-boolean function that accepts two arguments, the value returned by keyform and key. If no form exists for a matching key, the case form evaluates to nil. If the value of keyform is different from every key, and there is a default clause, its forms, if any, are evaluated sequentially, and the value of the last one is the result of the case form.
The same key (as determined by the match predicate) may occur only once in a case form.
case-using
syntax
(case-using predform keyform ((key*) form*)* [(t form*)]) => <object>
The case and case-using special forms, called case forms, provide a mechanism to execute a matching clause from a series of clauses based on the value of a dispatching form keyform.
The clause to be executed is identified by a set of keys. A key can be any object. If the keylist of the last clause is t the associated clause is executed if no key matches the keyform.
keyform is a form to be computed at the beginning of execution of the case form. If the result of evaluating keyform is equivalent to a key, then the forms, if any, in the corresponding clause are evaluated sequentially and the value of the last one is returned as value of the whole case form. case determines match equivalence by using eql; case-using match determines equivalence by using the result of evaluating predform. predform must be a boolean or quasi-boolean function that accepts two arguments, the value returned by keyform and key. If no form exists for a matching key, the case form evaluates to nil. If the value of keyform is different from every key, and there is a default clause, its forms, if any, are evaluated sequentially, and the value of the last one is the result of the case form.
The same key (as determined by the match predicate) may occur only once in a case form.
catch
syntax
(catch tag-form form*) => <object>
The special forms catch and throw provide a facility for programming of structured non-local dynamic exits. A catch form and a throw form are said to correspond if the tag-form of the catch and the tag-form of the throw evaluate to the same object, a catch tag. A catch tag may be any object other than a number or a character; the comparison of catch tags uses eq.
The catch special form first evaluates the tag-form to produce a catch tag, and then executes each form sequentially from left to right. If execution of the forms finishes normally, whatever is returned by the last form is returned by the catch form.
Prior to execution of the forms of a catch form C0, an association between the catch tag T0 and the executing form C0 is dynamically established, upon exit from C0, the association is disestablished. If there was an outer association for the same catch tag T0, it is hidden during the execution of C0's forms; only the most recently established (i.e., innermost) association for T0 is ever visible.
If a throw special form is executed, it evaluates the tag-form producing a catch tag T1, and then evaluates the result-form producing a result R1. If there is a corresponding association between T1 and some catch form C1 that is executing, R1 is immediately returned as the value of C1. The throw form can be anywhere in the entire current toplevel scope; it need not be lexically contained within C1.
An error shall be signaled if there is no outstanding catcher for a T1 (error-id. control-error). See §14.7.2 for other errors.
cdr
function
(cdr cons) => <object>
The function cdr returns the right component of the cons. An error shall be signaled if cons is not a cons (error-id. domain-error).
cdr
setf
(setf (cdr cons) obj) => <object>
Updates the right component of cons with obj. The returned value is obj . An error shall be signaled if cons is not a cons (error-id. domain-error). obj may be any ISLISP object.
ceiling
function
(ceiling x) => <integer>
Returns the smallest integer that is not smaller than x. That is, x is truncated towards positive infinity. An error shall be signaled if x is not a number (error-id. domain-error).
cerror
function
(cerror continue-string error-string obj*) => <object>
Like error, but the error that it signals is “continuable” (see continue-condition</span>). The extra argument continue-string describes what happens if this function returns.
This is equivalent to:
(signal-condition
(create (class <simple-error>)
'format-string error-string
'format-arguments (list obj*))
(let ((str (create-string-output-stream)))
(format str continue-string obj*)
(get-output-stream-string str)))
char-index
function
(char-index char string [start-position]) => <object>
Returns the position of char in string, The search starts from the position indicated by start-position (which is 0-based and defaults to 0). The value returned if the search succeeds is an offset from the beginning of the string, not from the starting point. If the char does not occur in the string, nil is returned. The function char= is used for the comparisons.
An error shall be signaled if char is not a character or if string is not a string (error-id. domain-error).
char/=
function
(char/= char1 char2) => boolean
Two characters are char/= if and only if they are not char=. If the test is satisfied, t is returned; otherwise, nil is returned.
An error shall be signaled if either char1 or char2 is not a character (error-id. domain-error).
char<
function
(char< char1 char2) => boolean
The function char< tests whether char1 is less than char2. The ordering used is the partial order defined above, extended to a total order on all characters in an implementation-defined manner. If the test is satisfied, t is returned; otherwise, nil is returned.
An error shall be signaled if either char1 or char2 is not a character (error-id. domain-error).
char<=
function
(char<= char1 char2) => boolean
The function char⇐ tests whether char1 is less than or equal to char2. The ordering used is the partial order defined above, extended to a total order on all characters in an implementation-defined manner. If the test is satisfied, t is returned; otherwise, nil is returned.
An error shall be signaled if either char1 or char2 is not a character (error-id. domain-error).
char=
function
(char= char1 char2) => boolean
The function char= tests whether char1 is the same character as char2. If the test is satisfied, t is returned; otherwise, nil is returned.
An error shall be signaled if either char1 or char2 is not a character (error-id. domain-error).
char>
function
(char> char1 char2) => boolean
Two characters are char> if and only if they are not char⇐.
An error shall be signaled if either char1 or char2 is not a character (error-id. domain-error).
char>=
function
(char>= char1 char2) => boolean
Two characters are char>= if and only if they are not char<.
An error shall be signaled if either char1 or char2 is not a character (error-id. domain-error).
characterp
function
(characterp obj) => boolean
Returns t if obj is a character (instance of class <character>); otherwise, returns nil. obj may be any ISLISP object.
class
syntax
(class class-name) => <class>
Returns the class object that corresponds to the class named class-name.
class-of
function
(class-of obj) => <class>
Returns the class of which the given obj is a direct instance. obj may be any ISLISP object.
close
function
(close stream) => nil
The function close closes the stream stream. If stream is closed it may no longer be used in input or output operations. Closing a file stream ends the association between the stream and its file. If the stream was already closed this function performs nothing. The result value is implementation defined. An error shall be signaled if stream is not a stream (error-id. domain-error).
closed-p
function
(closed-p stream) => boolean
Returns t if stream was explicitly closed, nil otherwise. If closed-p returns t it’s not a guarantee that attemping to use stream won’t signal a condition.
cond
syntax
(cond (test form*)*) => <object>
Executing the prepared cond, the clauses (test form*) are scanned sequentially and in each case the test is evaluated; when a test delivers a non-nil value the scanning process stops and all forms associated with the corresponding clause are sequentially evaluated and the value of the last one is returned. If no test is true, then nil is returned. If no form exists for the successful test then the value of this test is returned.
cond obeys the following equivalences:
(cond) = nil (cond (test1) (test2 form2*) …) = (or test1 (cond (test2 form2*) …)) (cond (test1 form1+) (test2 form2*) …) = (if test1 (progn form1+) (cond (test2 form2*) …))
condition-continuable
function
(condition-continuable condition) => <object>
Returns nil if condition is not continuable, or a string describing the effect of continuing otherwise.
cons
function
(cons obj1 obj2) => <cons>
This function builds a cons from two objects, with obj1 as its car (or `left') part and with obj2 as its cdr (or `right') part. An error shall be signaled if the requested cons cannot be allocated (error-id. cannot-create-cons). Both obj1 and obj2 may be any ISLISP object.
consp
function
(consp obj) => boolean
Returns t if obj is a cons (instance of class <cons>); otherwise, returns nil. obj may be any ISLISP object.
continue-condition
function
(continue-condition condition [value]) transfers control and data => nil
"Continues" from condition by finding the call to signal-condition and arranging for it to perform a normal return of the value, which defaults to nil. The consequences are undefined if the condition is not continuable.
convert
syntax
(convert obj class-name) => <object>
Returns an object of class class-name which corresponds to the object obj according to one of the following projections, called a coercion function. The table shows obj along the left-hand column and class-name along the top row (with <>'s in class names omitted here only for textual brevity):
| character | integer | float | symbol | string | general-vector | list | |
|---|---|---|---|---|---|---|---|
character |
= |
I |
- |
I(3) |
-(4) |
- |
- |
integer |
I |
= |
X |
- |
X(5) |
- |
- |
float |
- |
-(1) |
= |
- |
X(6) |
- |
- |
symbol |
- |
- |
- |
= |
I(3) |
- |
- |
string |
- |
X(2) |
X(2) |
I(3) |
= |
X(7) |
X |
general-vector |
- |
- |
- |
- |
- |
= |
X |
list |
- |
- |
- |
- |
- |
X |
= |
- =
-
This is the identity function
- X
-
This coercion shall be provided
- X(2)
-
An error shall be signaled if this coercion is attempted and the string does not contain the textual representation of a number of the target class. In all other respects, this is the same as parse-number.
- X(5)
-
This may be the same as the ~D format directive.
- X(6)
-
This may be the same as the ~G format directive.
- X(7)
-
This is the identity if strings are vectors in the implementation.
- I
-
This coercion shall be provided, but its definition is implementation defined.
- I(3)
-
This coercion shall be provided, but its definition is implementation defined. The coercion depends on the implementation’s neutral alphabetic characters (see §18.1.2).
- -
-
An error shall be signaled if this coercion is attempted.
- –(1)
-
Programmers requiring this kind of functionality may wish to consider instead using one of the functions, floor, ceiling, round, or truncate.
- –(4)
-
Programmers requiring this kind of functionality may wish to consider instead using the following: (create-string 1 obj)
If an implementation provides implementation-defined classes, it may also provide implementation-defined coercions for the names of those classes using convert.
cos
function
(cos x) => <number>
The function cos returns the cosine of x. x must be given in radians.
An error shall be signaled if x is not a number (error-id. domain-error).
cosh
function
(cosh x) => <number>
The function cosh returns the hyperbolic cosine of x.
An error shall be signaled if x is not a number (error-id. domain-error).
create
generic-function
(create class {initarg initval }*) => <object>
The function create creates and returns a new instance of a class. The argument is a class object.
The initialization of a new instance consists of several distinct steps, including the following: allocating storage for the instance, filling slots with values, and executing user-supplied methods that perform additional initialization. The last two steps of create are implemented by the generic function initialize-object to provide a mechanism for customizing those steps. The initialization arguments (the initargs and initvals) are given as a single list argument to initialize-object. The instance returned by create is the new instance, which has been modified and returned by initialize-object.
create-array
function
(create-array dimensions [initial-element]) => <basic-array>
This function creates an array of the given dimensions. The dimensions argument is a list of non-negative integers.
The result is of class <general-vector> if there is only one dimension, or of class <general-array*> otherwise.
If initial-element is given, the elements of the new array are initialized with this object, otherwise the initialization is implementation defined.
An error shall be signaled if the requested array cannot be allocated (error-id. cannot-create-array).
An error shall be signaled if dimensions is not a proper list of non-negative integers (error-id. domain-error). initial-element may be any ISLISP object.
create-list
function
(create-list i [initial-element]) => <list>
Returns a list of length i. If initial-element is given, the elements of the new list are initialized with this object; otherwise, the initialization is implementation defined. An error shall be signaled if the requested list cannot be allocated (error-id. cannot-create-list). An error shall be signaled if i is not a non-negative integer (error-id. domain-error). initial-element may be any ISLISP object.
create-string
function
(create-string i [initial-character ]) => <string>
Returns a string of length i. If initial-character is given, then the characters of the new string are initialized with this character, otherwise the initialization is implementation defined. An error shall be signaled if the requested string cannot be allocated (error-id. cannot-create-string). An error shall be signaled if i is not a non-negative integer or if initial-character is not a character (error-id. domain-error).
create-string-input-stream
function
(create-string-input-stream string) => <stream>
Creates and returns an input stream from the string. An error shall be signaled if string is not a string (error-id. domain-error).
create-string-output-stream
function
(create-string-output-stream) => <stream>
This function creates and returns a string output stream. The output to a string stream can be retrieved by get-output-stream-string.
create-vector
function
(create-vector i [initial-element]) => <general-vector>
Returns a general-vector of length i. If initial-element is given, the elements of the new vector are initialized with this object, otherwise the initialization is implementation defined. An error shall be signaled if the requested vector cannot be allocated (error-id. cannot-create-vector). An error shall be signaled if i is not a non-negative integer (error-id. domain-error). initial-element may be any ISLISP object.
current-stacktrace
function
(current-stacktrace) => <general-vector>
Returns stacktrace of current evaluation state. A stacktrace is a vector of stacktrace elements, where each element itself is a vector of (in order): module name, line start, column start, line end, column end.
debugger
syntax
(debugger) => <null>
Halts execution at this point when running in a debugger. Returns nil.
defclass
syntax
(defclass class-name (sc-name*) (slot-spec*) class-opt*) => <symbol>
Where:
class-name ::= identifier
sc-name ::= identifier
slot-spec ::= slot-name | (slot-name slot-opt*)
slot-name ::= identifier
slot-opt ::= :reader reader-function-name |
:writer writer-function-name |
:accessor reader-function-name |
:boundp boundp-function-name |
:initform form |
:initarg initarg-name
initarg-name ::= identifier
reader-function-name ::= identifier
writer-function-name ::= identifier
boundp-function-name ::= identifier
class-opt ::= (:metaclass class-name) |
(:abstractp abstract-flag)
abstract-flag ::= t | nil
The defclass defining form returns the symbol named class-name as its result.
The class-name argument is an identifier which becomes the name of the new class. The defining point of the class-name is the end of the defclass defining form.
Each superclass name argument sc-name is an identifier that specifies a direct superclass of the new class. The new class will inherit slots and their :reader or :writer or :accessor methods from each of its superclasses. See §15.1.3 for a definition of how slots are inherited, and §15.2.3 for a definition of how methods are inherited. No sc-name may appear more than once in super class names. It is a violation if the superclasses of any two direct superclasses sc-name have superclasses other than <standard-object> and <object> in common unless a metaclass other than <standard-class> is specified.
Each slot-spec argument is the name of the slot or a list consisting of the slot name followed by zero or more slot options. The slot-name argument is an identifier that is syntactically valid for use as an ISLISP variable name. No slot names may appear more than once in slot-spec The following slot options are available:
-
The :reader slot option specifies that an unqualified method with the parameter profile x class-name is to be defined on the generic function named reader-function-name to retrieve the value of the given slot. The :reader slot option may be specified more than once for a given slot.
-
The :writer slot option specifies that an unqualified method with the parameter profile y object) (x class-name is to be defined on the generic function named writer-function-name to store the value into the slot. The writer-function-name argument is an identifier. The :writer slot option may be specified more than once for a given slot.
-
The :accessor slot option specifies that an unqualified method is to be defined on the generic function named reader-function-name to retrieve the value of the given slot. Furthermore, there is a generic function such that (setf (reader-function-name x) y) is equivalent to calling this generic function with first argument y and second argument x. This generic function is extended by a method with the parameter profile y object) (x class-name. The reader-function-name argument is an identifier. The :accessor slot option may be specified more than once for a given slot.
-
The :boundp slot option specifies that an unqualified method with the parameter profile x class-name is to be defined on the generic function named boundp-function-name to test whether the given slot has been given a value. The :boundp slot option may be specified more than once for a given slot.
-
The :initform slot option is used to provide a default initial value form to be used in the initialization of the slot. The :initform slot option may be specified once at most for a given slot. This form is evaluated every time it is used to initialize the slot. The lexical scope of the identifiers used in the initialization of the slot is the lexical scope of those identifiers in the defclass form. Note that the lexical scope refers both to variable and to function identifiers. In contrast, the current dynamic bindings used are those existing during activation of create. For more information, see §15.4.1.
-
The :initarg slot option declares an initialization argument named initarg-name and specifies that this initialization argument initializes the given slot. If the initialization argument and associated value are supplied in the call to initialize-object, the value will be stored into the given slot and the slot’s :initform slot option, if any, is not evaluated. If none of the initialization arguments specified for a given slot has a value, the slot is initialized according to the :initform option, if specified. The consequences are undefined if more than one initialization argument for the same slot is supplied. For more information, see §15.4.1.
The generic functions, to which the methods created by the :reader, :writer, and :accessor slot options belong are called slot accessors.
No implementation is permitted to extend the syntax of defclass to allow (slot-name form) as an abbreviation for (slot-name :initform form).
Each class option is an option that refers to the class as a whole. The following class options are available:
-
The :metaclass class option is used to specify that instances of the class being defined are to have a different metaclass than the default provided by the system, that is, different from the class standard-class. The class-name argument is the name of the desired metaclass. The :metaclass class option may be specified once at most. It is a violation if built-in-class is specified as the metaclass.
-
The :abstractp class option is used to specify that the class is an abstract class. If this option is supplied and abstract-flag is t, create will signal an error if an attempt is made to create an instance of this class. If the option is unsupplied, or if abstract-flag is nil, the class is not an abstract class. It is a violation if the abstract-flag is supplied but is neither t nor nil.
The following rules of defclass hold for standard classes:
-
The defclass defining form must be in the scope of any superclass identifier it refers to.
-
All the superclasses of a class must be defined before an instance of the class can be made.
-
Any reference to class-name as a parameter specializer in a defmethod form must be in the scope of class-name. That is, a defmethod form that names a class must textually follow the defclass form that defines that class.
An ISLISP processor may be extended to cover situations where these rules are not obeyed. These extensions shall be implementation defined.
Some slot options are inherited by a class from its superclasses, and some can be shadowed or altered by providing a local slot description. No class options are inherited. For a detailed description of how slots and slot options are inherited, see the section §15.1.3.
If no slot accessors are specified for a slot, the slot cannot be accessed.
When a class is defined, the order in which its direct superclasses are mentioned in the defining form is important. The new class has a local precedence order, which is a list consisting of the class followed by its direct superclasses in the order mentioned in its defclass defining form.
defconstant
syntax
(defconstant name form) => <symbol>
This form is used to define a named constant in the variable namespace of the current toplevel scope. The scope of name is the entire current toplevel scope except the body form.
Although name is globally constant, a variable binding for name can be locally established by a binding form.
The result of the evaluation of form is bound to the variable named by name. The binding and the object created as the result of evaluating the second argument are immutable. The symbol named name is returned.
defdynamic
syntax
(defdynamic name form) => <symbol>
This form is used to define a dynamic variable identifier in the dynamic variable namespace. The scope of name is the entire current toplevel scope except the body form.
The symbol named name is returned.
defgeneric
syntax
(defgeneric func-spec lambda-list {option | method-desc}*) => <symbol>
Where:
func-spec ::= identifier | (setf identifier)
lambda-list ::= (var* [&rest var]) |
(var* [:rest var])
option ::= (:method-combination {identifier | keyword}) |
(:generic-function-class class-name)
method-desc ::= (:method method-qualifier* parameter-profile form*)
method-qualifier ::= identifier | keyword
parameter-profile ::= ({var | (var parameter-specializer-name)}* [{&rest | :rest} var])
parameter-specializer-name ::= class-name
class-name ::= identifier
var ::= identifier
The defgeneric defining form is used to define a generic function and to specify options and declarations that pertain to a generic function as a whole.
It returns the generic function name func-spec.
The scope of the generic function identifier func-spec is the entire current toplevel scope.
The lambda-list argument is an ordinary function lambda-list.
The following options are provided. A given option may occur only once.
-
The :generic-function-class option specifies that the generic function is to have a different class from the default provided by the system, that is, different from the class standard-generic-function. The class-name argument is the name of a class that can be the class of a generic function.
-
The :method-combination option is followed by a symbol or keyword that names a type of method combination. The names of the built-in method combination types are nil and standard.
The method-desc arguments define methods that will belong to the generic function, as if defined by defmethod. The method-qualifier and parameter-profile arguments in a method description are the same as for defmethod. The form arguments specify the method body.
If no method descriptions are specified, a generic function with no methods is created. An error shall be signaled if a generic function is called and no methods apply.
The lambda-list argument of defgeneric specifies the shape of lambda-lists for the methods on this generic function. All methods on the resulting generic function must have parameter-profiles that are congruent with this shape. For further details on method congruence, see §15.2.2.2.
Implementations can extend defgeneric to include other implementation-defined options.
defglobal
syntax
(defglobal name form) => <symbol>
This form is used to define an identifier in the variable namespace of the current toplevel scope. The scope of name is the entire current toplevel scope except the body form.
form is evaluated to compute an initializing value for the variable named name. Therefore, defglobal is used only for defining variables and not for modifying them. The symbol named name is returned.
A lexical variable binding for name can still be locally established by a binding form; in that case, the local binding lexically shadows the outer binding of name defined by defglobal.
defmacro
syntax
(defmacro macro-name lambda-list form*) => <symbol>
Defines a named (toplevel) macro. No implicit block with the macro name is established when the macro-expansion function is invoked. macro-name must be an identifier whose scope is the current toplevel scope in which the defmacro form appears. lambda-list is as defined in page 23. The definition point of macro-name is the closing parenthesis of the lambda-list.
defmethod
syntax
(defmethod func-spec method-qualifier* parameter-profile form*) => <symbol>
Where:
func-spec ::= identifier | (setf identifier)
method-qualifier ::= identifier | keyword
parameter-profile ::= ({var | (var parameter-specializer-name)}* [{&rest | :rest} var])
parameter-specializer-name ::= class-name
class-name ::= identifier
var ::= identifier
The defmethod defining form defines a method on a generic function. It returns the generic function name func-spec.
A method-defining form contains the code that is to be executed when the arguments to the generic function cause the method that it defines to be invoked.
Preparing a method-defining form for execution causes one of the following cases:
-
It is a violation if the given name func-spec already designates a generic function and this generic function contains a method that agrees with the new one on parameter specializers and qualifiers. For a definition of one method agreeing with another on parameter specializers and qualifiers, see the section §15.2.2.1.
-
If the given name func-spec designates a generic function and this generic function does not contain a method that agrees with the new one on parameter specializers and qualifiers, the new method is added to the generic function.
-
It is a violation if the defmethod defining form is in the scope of a func-spec identifier that does not designate a generic function.
-
It is a violation if the given name func-spec does not exist in the current toplevel scope immediately containing the defmethod defining form. Furthermore, it is a violation if a defgeneric form for func-spec does not precede the method-defining form in the text unit being prepared for execution unless the method-defining form is a defclass.
The parameter-profile of the method being defined must be congruent with the lambda-list of the generic function. See §15.2.2.2 for a definition of congruence in this context.
Each method-qualifier argument is an object that is used as an attribute to the given method by method combination. A method qualifier is a non-nil symbol or keyword. The method combination type further restricts what a method qualifier may be. The standard method combination type allows for unqualified methods or methods whose sole qualifier is one of the keywords :before, :after, :around.
The parameter-profile argument is like an ordinary function lambda-list except that the names of required parameters can be replaced by specialized parameters. A specialized parameter is a list of the form (variable-name parameter-specializer-name). Only required parameters may be specialized. A parameter specializer name is an identifier that names a class. If no parameter specializer name is specified for a given required parameter, the parameter specializer defaults to the class named <object>.
The form arguments specify the method body.
No two methods with agreeing parameter specializers and qualifiers may be defined for the same generic function. See the section §15.2.2.1 for a definition of agreement in this context.
A method is not a function and cannot be invoked as a function.
defun
syntax
(defun function-name lambda-list form*) => <symbol>
The defun-form defines function-name as an identifier in the function namespace; function-name is bound to a function object equivalent to (lambda lambda-list form*).
The scope of function-name is the whole current toplevel scope. Therefore, the definition of a function admits recursion, occurrences of function-name within the form* refer to the function being defined. The binding between function-name and the function object is immutable.
defun returns the function name which is the symbol named function-name. The free identifiers in the body form* (i.e., those which are not contained in the lambda list) follow the rules of lexical scoping.
delete-file
function
(delete-file filename) => <null>
Deletes a file denoted by string path filename.
div
function
(div z1 z2) => <integer>
div returns the greatest integer less than or equal to the quotient of z1 and z2. An error shall be signaled if z2 is zero (error-id. division-by-zero).
mod returns the remainder of the integer division of z1 by z2. The sign of the result is the sign of z2. The result lies between 0 (inclusive) and z2 (exclusive), and the difference of z1 and this result is divisible by z2 without remainder.
div and mod satisfy:
(= z1 (+ (* (div z1 z2) z2) (mod z1 z2)))
That is, the evaluation of the above form always return t.
An error shall be signaled if either z1 or z2 is not an integer (error-id. domain-error).
documentation
function
(documentation [name-space] symbol) => <object>
Retrieves documentation associated symbol. If name-space is provided (which must be one of class, function, syntax, setf, value, dynvar), only looks in given namespace. Otherwise returns first entry from any namespace. Documentation is searched for both current module, and the modules it requires. If no documentation is found, nil is returned.
Documentation is an alist, which always has following keys:
key |
value |
|
A symbol denoting the kind, one of: class, function, local-function, generic-function, syntax, setf, constant, dynvar. |
|
A string for free-form description, using asciidoc syntax |
Additionally, depending on kind, following keys are present:
key |
required kind |
value |
syntax |
function, local-function, generic-function, syntax, setf |
A string denoting use. A |
return-type |
function, local-function, generic-function, syntax |
A string indicating what the expression returns, usually as a class reference. |
min-args |
function, local-function, generic-function |
Minimum amount of arguments function requires |
max-args |
function, local-function, generic-function |
Maximum amount of arguments function can handle; nil if unbound |
value-type |
dynvar, constant |
The type of dynamic var’s or constant’s value, usually as a class reference. |
superclasses |
class |
List of superclasses of a class, as a list of strings. |
slots |
class |
List of slots of a class, as a list of symbols. |
abstract |
class |
t if a class is abstract, nil otherwise. |
documentation
setf
(setf (documentation name-space symbol) docvalue) => <object>
Sets documentation value for given name-space and symbol in current module. See documentation for details about documentation format.
Returns previously stored documentation entry.
domain-error-expected-class
function
(domain-error-expected-class domain-error) => <class>
These function returns the expected-class supplied as data when creating the domain-error. An error shall be signaled if domain-error is not a condition of class <domain-error> (error-id. domain-error).
domain-error-object
function
(domain-error-object domain-error) => <object>
These functions returns the object supplied as data when creating the domain-error. An error shall be signaled if domain-error is not a condition of class <domain-error> (error-id. domain-error).
dynamic
setf
(setf (dynamic var) form) => <object>
This special form denotes an assignment to a dynamic variable. This form can appear anywhere that (dynamic var) can appear.
form is evaluated and the result of the evaluation is used to change the dynamic binding of var.
An error shall be signaled if var has no dynamic value (error-id. unbound-variable). setf of dynamic can be used only for modifying bindings, and not for establishing them.
dynamic
syntax
(dynamic var) => <object>
This special form denotes a reference to the identifier denoting a dynamic variable. This special form is not allowed in the scope of a definition of var which is not done by defdynamic or dynamic-let.
During activation, the current dynamic binding of the variable var is returned that was established most recently and is still in effect. An error shall be signaled if such a binding does not exist (error-id. unbound-variable).
dynamic-let
syntax
(dynamic-let ((var form)) body-form) => <object>
The dynamic-let special form is used to establish dynamic variable bindings. The first subform (the dynamic-let variable list) is a list of pairs (var form). The scope of an identifier var defined by dynamic-let is the current toplevel scope. The extent of the bindings of each var is the extent of the body of the dynamic-let. The dynamic-let special form establishes dynamic variables for all vars.
References to a dynamic variable named by var must be made through the dynamic special form.
All the initializing forms are evaluated sequentially from left to right, and then the values are associated with the corresponding vars. Using these additional dynamic bindings and the already existing bindings of visible identifiers, the forms body-form* are evaluated in sequential order. The returned value of dynamic-let is that of the last body-form of the body (or nil if there is none). The bindings are undone when control leaves the prepared dynamic-let special form.
elt
function
(elt sequence z) => <object>
Given a sequence and an integer z satisfying 0 ≤ z < (length sequence), elt returns the element of sequence that has index z. Indexing is 0-based; i.e., z = 0 designates the first element. An error shall be signaled if z is an integer outside of the mentioned range (error-id. index-out-of-range).
An error shall be signaled if sequence is not a basic-vector or a list or if z is not an integer (error-id. domain-error).
elt
setf
(setf (elt sequence z) obj) => <object>
These replace the object obtainable by elt with obj. The returned value is obj.
An error shall be signaled if z is an integer outside of the valid range of indices (error-id. index-out-of-range). An error shall be signaled if sequence is not a basic-vector or a list or if z is not an integer (error-id. domain-error). obj may be any ISLISP object.
eq
function
(eq obj1 obj2) => boolean
eq tests whether obj1 and obj2 are same identical object. It returns t if the objects are the same; otherwise, they return nil. Two objects are the same if there is no operation that could distinguish them (without modifying them), and if modifying one would modify the other the same way.
For eq, the consequences are implementation defined if both obj1 and obj2 are numbers or both are characters.
eql
function
(eql obj1 obj2) => boolean
eql tests whether obj1 and obj2 are same identical object. It returns t if the objects are the same; otherwise, they return nil. Two objects are the same if there is no operation that could distinguish them (without modifying them), and if modifying one would modify the other the same way.
For eql the meaning for numbers and characters is defined as follows:
-
If obj1 and obj2 are numbers, eql tests whether they are direct instances of the same class and have the same value. If an implementation supports positive and negative zeros as distinct values, then (eql 0.0 -0.0) returns nil. When the syntax -0.0 is read and it is interpreted as the value 0.0 then (eql 0.0 -0.0) returns t.
-
If obj1 and obj2 are characters, eql tests whether they are the same character (see char=).
equal
function
(equal obj1 obj2) => boolean
This function tests whether obj1 and obj2 are isomorphic—i.e., whether obj1 and obj2 denote the same structure with equivalent values. equal returns t if the test was satisfied, and nil if not. Specifically:
If obj1 and obj2 are direct instances of the same class, equal returns t if they are eql. Otherwise (if they are direct instances of the same class but not eql), the result is t if one of the following cases applies:
-
lists: either obj1 and obj2 are both the empty list (i.e., nil), or
(and (equal (car obj1) (car obj2)) (equal (cdr obj1) (cdr obj2)))holds;
-
basic arrays:
(equal (array-dimensions obj1) (array-dimensions obj2))holds and for every valid reference (aref obj1 ind1 …indn)
(equal (aref obj1 ind1 … indn) (aref obj2 ind1 … indn))is satisfied.
Otherwise the value is nil.
obj1 and obj2 may be any ISLISP objects.
error
function
(error error-string obj*) => <object>
An error shall be signaled.
error-string and the objs are advice to the implementation about how the error message might be textually described (using format), but whether or not that advice is used is implementation defined.
This is equivalent to:
(signal-condition
(create (class <simple-error>)
'format-string error-string
'format-arguments (list obj*))
nil)
error-output
function
(error-output) => <stream>
The function error-output returns the stream used as the default stream for warnings and non-interactive error messages.
The value returned by the function is initially implementation-defined, but can be dynamically bound; see with-error-output.
exit
function
(exit code)
Immediately exits execution, with code as return code (0 for success, anything else indicating failure).
exp
function
(exp x) => <number>
Returns e raised to the power x, where e is the base of the natural logarithm. An error shall be signaled if x is not a number (error-id. domain-error).
expt
function
(expt x1 x2) => <number>
Returns x1 raised to the power x2. The result will be an integer if x1 is an integer and x2 is a non-negative integer. An error shall be signaled if x1 is zero and x2 is negative, or if x1 is zero and x2 is a zero float, or if x1 is negative and x2 is not an integer.
file-length
function
(file-length filename element-class) => <object>
Returns the length of the file named by filename, or returns nil if the length cannot be determined. The element-class determines the units. An error shall be signaled if filename is not a string (error-id. domain-error).
file-position
function
(file-position stream) => <integer>
Returns the file position associated with stream.
A file position is a non-negative integer that represents a position in the stream. For binary streams, the file position represents the number of preceding bytes in the stream. It is increased by one each time one of the following is done:
(read-byte stream) (write-byte z stream)
For character streams, the file position is increased by an implementation-defined non-negative amount each time one of the following is done:
(format stream…) (format-char stream char) (format-float stream float) (format-fresh-line stream) (format-integer stream integer radix) (format-object stream obj escape-p) (format-tab stream column) (report-condition condition stream) (read-char stream) (read-line stream) (read stream)
The amount may depend on the output and on the file position itself. It is implementation-defined which integer represents the first element of the file. An error shall be signaled if stream is not a stream to or from a file (error-id. domain-error).
fill-stacktrace
generic-function
(fill-stacktrace condition) => boolean
Generic function to determine if for given condition a stacktrace should be filled in. Defaults to t for <serious-condition>. Add methods overriding it to return nil to disable it to remove cost of stacktrace fill in.
finish-output
function
(finish-output stream) => <null>
Completes any pending output to the destination designated by stream. Waits until the pending output is complete and then returns nil. For instance, pending output might be stored in a buffer; in this case finish-output forces the buffer to be written to the stream’s destination. An error shall be signaled if stream is not a stream that can handle output operations (error-id. domain-error).
flet
syntax
(flet ((function-name lambda-list form*)) body-form) => <object>
The labels special form allows the definition of new identifiers in the function namespace for function objects.
In a flet special form, the scope of an identifier is only the body-form*. Within this scope, each function-name is bound to a function object whose behavior is equivalent to (lambda lambda-list form*). Free identifier references in the lambda-expression are resolved in the lexical environment that was active immediately outside the flet form (i.e., any reference to a function function-name are not visible).
During activation, the prepared flet establishes function bindings and then evaluates each body-form in the body sequentially; the value of the last one (or nil if there is none) is the value returned by the special form activation.
No function-name may appear more than once in the function bindings.
float
function
(float x) => <float>
Returns x itself if it is an instance of the class <float> and returns a floating-point approximation of x otherwise. An error shall be signaled if x is not a number (error-id. domain-error).
floatp
function
(floatp obj) => boolean
Returns t if obj is a float (instance of class <float>); otherwise, returns nil. The obj may be any ISLISP object.
floor
function
(floor x) => <integer>
Returns the greatest integer less than or equal to x. That is, x is truncated towards negative infinity. An error shall be signaled if x is not a number (error-id. domain-error).
for
syntax
(for (iteration-spec*) (end-test result*) form*) => <object>
Where: iteration-spec ::= (var init [step])
for repeatedly executes a sequence of forms form*, called its body. It specifies a set of identifiers naming variables that will be local to the for form, their initialization, and their update for each iteration. When a termination condition is met, the iteration exits with a specified result value.
The scope of an identifier var is the body, the steps, the end-test, and the result*. A step might be omitted, in which case the effect is the same as if (var init var) had been written instead of (var init). It is a violation if more than one iteration-spec names the same var in the same for form.
The for special form is executed as follows: The init forms are evaluated sequentially from left to right. Then each value is used as the initial value of the variable denoted by the corresponding identifier var, and the iteration phase begins.
Each iteration begins by evaluating end-test. If the result is nil, the forms in the body are evaluated sequentially (for side-effects). Afterwards, the step-forms are evaluated sequentially order from left to right. Then their values are assigned to the corresponding variables and the next iteration begins. If end-test returns a non-nil value, then the result* are evaluated sequentially and the value of the last one is returned as value of the whole for macro. If no result is present, then the value of the for macro is nil.
format
function
(format output-stream format-string obj*) => <null>
The function format has the side-effect of printing according to format-string. It returns nil. An error shall be signaled if the output-stream parameter does not satisfy the output-stream-p predicate (error-id. not-an-output-stream). An error shall be signaled if format-string is not a string (error-id. domain-error). The following is a summary of all the available format directives:
obj refers to the next item of the set of obj* to be processed.
- ~A
-
Aesthetic: The obj is any object. obj is printed as it would with ~S, but without escape characters. Characters are output directly without any conversion. That is, the output generated using this format directive is suitable for being read by a human reader.
- ~B
-
Binary: An error shall be signaled if obj is not an integer. obj is printed in binary radix (radix 2).
- ~C
-
Character: An error shall be signaled if obj is not a character. obj is output directly without any conversion.
- ~D
-
Decimal: An error shall be signaled if obj is not an integer. obj is printed in decimal radix (radix 10).
- ~G
-
General floating point: An error shall be signaled if obj is not a number. obj is printed as a float.
- ~O
-
Octal: An error shall be signaled if obj is not an integer. obj is printed in octal radix (radix 8).
- ~_n_R
-
Radix: An error shall be signaled if obj is not an integer. obj is printed in radix n (which must be between 2 and 36, inclusive).
- ~S
-
S-expression: obj is any object. This format directive outputs the textual representation of obj, with escape characters as needed. That is, the output generated using this format directive is suitable for input to the function read.
- ~_n_T
-
Tab: output enough spaces to move to column n (where column 0 represents the left margin). If already at or beyond column n, one space is output. If an implementation cannot determine the current column position, the behavior is implementation defined, but at least one space will be output.
- ~X
-
Hexadecimal: An error shall be signaled if obj is not an integer. obj is printed in hexadecimal radix (radix 16).
- ~%
-
newline: output a #\newline character;
- ~&
-
conditional newline: output a #\newline character if it cannot be determined that the output stream is at the beginning of a fresh line;
- ~~
-
tilde: output a tilde (~).
format-char
function
(format-char output-stream char) => <null>
An error shall be signaled if obj is not a character. obj is output directly without any conversion.
format-float
function
(format-float output-stream float) => <null>
An error shall be signaled if obj is not a number. obj is printed as a float.
format-fresh-line
function
(format-fresh-line output-stream) => <null>
Output a #\newline character if it cannot be determined that the output stream is at the beginning of a fresh line.
format-integer
function
(format-integer output-stream integer radix) => <null>
An error shall be signaled if obj is not an integer. obj is printed in given radix.
format-object
function
(format-object output-stream obj escape-p) => <null>
obj is any object. This format directive outputs the textual representation of obj. If escape-p is not nil, the output generated using this format directive is suitable for input to the function read. Otherwise characters are output directly without any conversion. That is, the output generated using this format directive is suitable for being read by a human reader.
format-tab
function
(format-tab output-stream column) => <null>
Output enough spaces to move to column n (where column 0 represents the left margin). If already at or beyond column n, one space is output. If an implementation cannot determine the current column position, the behavior is implementation defined, but at least one space will be output.
funcall
function
(funcall function obj*) => <object>
Activates the specified function function and returns the value that the function returns. The i_th argument (2 ≤ _i) of funcall becomes the (i − 1)th argument of the function. funcall could have been defined using apply as follows:
(defun funcall (function :rest arguments) (apply function arguments))
An error shall be signaled if _function_ is not a function (error-id. _domain-error_). Each _obj_ may be any ISLISP object.
function
syntax
(function function-name) => <function>
This special form denotes a reference to the function named by function-name. This special form is used to refer to identifiers defined by function-defining forms, labels, or flet which are not in operator position.
(function function-name) can be written as #'function-name.
It returns the function object named by function-name.
An error shall be signaled if no binding has been established for the identifier in the function namespace of current lexical environment (see §9.2) (error-id. undefined-function). The consequences are undefined if the function-name names a macro or special form.
functionp
function
(functionp obj) => boolean
Returns t if obj is a (normal or generic) function; otherwise, returns nil. obj may be any ISLISP object.
garef
function
(garef general-array z*) => <object>
garef is like aref but an error shall be signaled if its first argument, general-array, is not an object of class <general-vector> or of class <general-array*> (error-id. domain-error).
garef
setf
(setf (garef general-array z*) obj) => <object>
Replaces the object obtainable by garef with obj. The returned value is obj. The constraints on the basic-array, the general-array, and the sequence of indices z is the same as for garef.
gcd
function
(gcd z1 z2) => <integer>
gcd returns the greatest common divisor of its integer arguments. The result is a non-negative integer. For nonzero arguments the greatest common divisor is the largest integer z such that z1 and z2 are integral multiples of z.
An error shall be signaled if either z1 or z2 is not an integer (error-id. domain-error).
general-array*-p
function
(general-array*-p obj) => boolean
general-array*-p returns t if obj is a general-array* (instance of class <general-array*>); otherwise, returns nil. obj may be any ISLISP object.
general-vector-p
function
(general-vector-p obj) => boolean
general-vector-p returns t if obj is a general-vector (instance of class <general-vector>); otherwise, returns nil. obj may be any ISLISP object.
generic-function-p
function
(generic-function-p obj) => boolean
Returns t if obj is a generic function; otherwise, returns nil. obj may be any ISLISP object.
gensym
function
(gensym) => <symbol>
Returns an unnamed symbol. gensym is useful for writing macros. It is impossible for an identifier to name an unnamed symbol.
get-internal-real-time
function
(get-internal-real-time) => <integer>
get-internal-real-time returns as an integer the current time in internal time units, relative to an arbitrary time base. The difference between the values of two calls to this function is the amount of elapsed real time (i.e., clock time) between the two calls.
get-internal-run-time
function
(get-internal-run-time) => <integer>
get-internal-run-time returns as an integer the current run time in internal time units. The precise meaning of this quantity is implementation defined. The difference between the values of two calls to this function is the amount of time between the two calls during which computational effort was expended on behalf of the executing program.
get-output-stream-string
function
(get-output-stream-string stream) => <string>
Returns a string containing all characters written to stream since the last call to this function or since the creation of the stream, if this function has not been called with stream before. An error shall be signaled if stream is not a stream created with create-string-output-stream (error-id. domain-error).
get-universal-time
function
(get-universal-time) => <integer>
Returns an approximation to the "current time" in Universal Time Format. The units are seconds. Universal Time Format represents time as an integer number of seconds since the beginning (i.e., midnight), January 1, 1900 UT (ignoring leap seconds). If get-universal-time is called twice, the first value shall be less than or equal to the second value.
No implementation is required to have a way to verify that the time returned is correct. However, an error shall be signaled if an implementation can determine that the time it would return would not be correct (e.g., it can determine that the clock was never initialized).
go
syntax
(go tagbody-tag) transfers control => nil
Used to transfer control to a tag tag that appears among the tagbody-tags in the surrounding tagbody form. See tagbody for details.
identity
function
(identity obj) => <object>
Returns an object that is the same as obj under eql. obj may be any ISLISP object.
if
syntax
(if test-form then-form [else-form]) => <object>
The test-form is evaluated. If its result is anything non-nil, the then-form is evaluated and its value is returned; otherwise (if the test-form returned nil), the else-form is evaluated and its value is returned.
If no else-form is provided, it defaults to nil.
ignore-errors
syntax
(ignore-errors form*) => <object>
Establishes a handler for <error>, such that if an error occurs during execution of forms, ignore-errors will immediately return nil. Then it executes forms, returning the value returned by the last form (or nil if there were no forms) if execution terminates normally.
initialize-object
generic-function
(initialize-object instance initialization-arguments) => <object>
The generic function initialize-object is called by create to initialize a newly created instance. The generic function initialize-object is called with the new instance and a list of initialization arguments.
The system-supplied primary method on initialize-object initializes the slots of the instance with values according to the initialization-arguments (an alternating list of initialization argument keywords and values) and the :initform forms of the slots.
The instance argument is the object to be initialized. The modified instance is returned as the result. Programmers can define methods for initialize-object to specify actions to be taken when an instance is initialized. If only :after methods are defined, they will be run after the system-supplied primary method for initialization and therefore will not interfere with the default behavior of initialize-object. The consequences are undefined if a programmer-defined primary method for this generic function does not return instance.
input-stream-p
function
(input-stream-p obj) => boolean
Returns t if obj is a stream that can handle input operations; otherwise, returns nil.
instancep
function
(instancep obj class) => boolean
Returns t if obj is an instance (directly or otherwise) of the class class; otherwise, returns nil. obj may be any ISLISP object. An error shall be signaled if class is not a class object (error-id. domain-error).
integerp
function
(integerp obj) => boolean
Returns t if obj is an integer (instance of class <integer>); otherwise, returns nil. obj may be any ISLISP object.
internal-time-units-per-second
function
(internal-time-units-per-second) => <integer>
internal-time-units-per-second returns the number of time units per second for the implementation.
isqrt
function
(isqrt z) => <integer>
Returns the greatest integer less than or equal to the exact positive square root of z. An error shall be signaled if z is not a non-negative integer (error-id. domain-error).
labels
syntax
(labels ((function-name lambda-list form*)) body-form) => <object>
The labels special form allows the definition of new identifiers in the function namespace for function objects.
In a labels special form the scope of an identifier function-name is the whole labels special form (excluding nested scopes, if any). Within this scope, each function-name is bound to a function object whose behavior is equivalent to (lambda lambda-list form*).
Free references are resolved in the lexical environment that was active immediately outside the labels form augmented by the function bindings for the given function-names (i.e., any reference to a function function-name refers to a binding created by the labels).
During activation, the prepared labels establishes function bindings and then evaluates each body-form in the body sequentially; the value of the last one (or nil if there is none) is the value returned by the special form activation.
No function-name may appear more than once in the function bindings.
lambda
syntax
(lambda lambda-list form*) => <function>
Where:
lambda-list ::= (identifier* [&rest identifier]) |
(identifier* [:rest identifier])
and where no identifier may appear more than once in lambda-list.
Execution of the lambda special form creates a function object.
The scope of the identifiers of the lambda-list is the sequence of forms form*, collectively referred to as the body.
When the prepared function is activated later (even if transported as object to some other activation) with some arguments, the body of the function is evaluated as if it was at the same textual position where the lambda special form is located, but in a context where the lambda variables are bound in the variable namespace with the values of the corresponding arguments. A &rest or :rest variable, if any, is bound to the list of the values of the remaining arguments. An error shall be signaled if the number of arguments received is incompatible with the specified lambda-list (error-id. arity-error).
Once the lambda variables have been bound, the body is executed. If the body is empty, nil is returned otherwise the result of the evaluation of the last form of body is returned if the body was not left by a non-local exit (see §14.7.1).
If the function receives a &rest or :rest parameter R, the list L1 to which that parameter is bound has indefinite extent. L1 is newly allocated unless the function was called with apply and R corresponds to the final argument, L2, to that call to apply (or some subtail of L2), in which case it is implementation defined whether L1 shares structure with L2.
lcm
function
(lcm z1 z2) => <integer>
lcm returns the least common multiple of its integer arguments. gcd and lcm satisfies:
(= (* (gcd m n) (lcm m n)) (abs (* m n)))
That is, the evaluation of the above form always return t.
An error shall be signaled if either z1 or z2 is not an integer (error-id. domain-error).
length
function
(length sequence) => <integer>
Returns the length of sequence as an integer greater than or equal to 0.
When sequence is a basic-vector, length returns its dimension.
When sequence is a list, the result is the number of elements in the list; if an element is itself a list, the elements within this sublist are not counted. In the case of dotted lists, length returns the number of conses at the uppermost level of the list. For example, (length '(a b . c)) ⇒ 2, since '(a b . c) ≡ (cons 'a (cons 'b 'c)).
An error shall be signaled if sequence is not a basic-vector or a list (error-id. domain-error).
let
syntax
(let ((var form)) body-form) => <object>
The let special form is used to define a scope for a group of identifiers for a sequence of forms body-form* (collectively referred to as the body). The list of pairs (var form)* is called the let variable list. The scope of the identifier var is the body.
The forms are evaluated sequentially from left to right; then each variable denoted by the identifier var is initialized to the corresponding value. Using these bindings along with the already existing bindings of visible identifiers the body-forms are evaluated. The returned value of let is the result of the evaluation of the last body-form of its body (or nil if there is none).
No var may appear more than once in let variable list.
| Although this form is a special form, one can think of it as a macro whose rewriting rules are as follows: |
(let () body-form*) |
(progn body-form*) |
(let var1 form1) (var2 form2) … (varn formn body-form*) |
((lambda (var1 var2 … varn) body-form*) form1 form2 … formn) |
let*
syntax
(let* ((var form)) body-form) => <object>
The let* form is used to define a scope for a group of identifiers for a sequence of forms body-form* (collectively referred to as the body). The first subform (the let* variable list) is a list of pairs (var form). The scope of an identifier var is the body along with all form forms following the pair (var form) in the let* variable list.
For each pair (var form) the following is done: form is evaluated in the context of the bindings in effect at that point in the evaluation. The result of the evaluation is bound to its associated variable named by the identifier var. These variable bindings enlarge the set of current valid identifiers perhaps shadowing previous variable bindings (in case some var was defined outside), and in this enlarged or modified environment the body-forms are executed. The returned value of let* is the result of the evaluation of the last form of its body (or nil if there is none).
| Although this form is a special form, one can think of it as a macro whose rewriting rules are as follows: |
(let* () body-form*) |
(progn body-form*) |
(let* var1 form1) (var2 form2) … (varn formn body-form*) |
(let var1 form1 (let var2 form2 … (let varn formn body-form*)…)) |
list
function
(list obj*) => <list>
Returns a new list whose length is the number of arguments and whose elements are the arguments in the same order as in the list-form. An error shall be signaled if the requested list cannot be allocated (error-id. cannot-create-list). Each obj may be any ISLISP object.
listp
function
(listp obj) => boolean
Returns t if obj is a list (instance of class <list>); otherwise, returns nil. obj may be any ISLISP object.
log
function
(log x) => <number>
Returns the natural logarithm of x. An error shall be signaled if x is not a positive number (error-id. domain-error).
map-into
function
(map-into destination function sequence*) => <sequence>
Destructively modifies destination to contain the results of applying function to successive elements in the sequences. The destination is returned.
If destination and each element of sequences are not all the same length, the iteration terminates when the shortest sequence (of any of the sequences or the destination) is exhausted.
The calls to function proceed from left to right, so that if function has side-effects, it can rely upon being called first on all of the elements with index 0, then on all of those numbered 1, and so on.
An error shall be signaled if destination is not a basic-vector or a list (error-id. domain-error).
An error shall be signaled if any sequence is not a basic-vector or a list (error-id. domain-error).
mapc
function
(mapc function list+) => <list>
Successively applies the given function to sets of arguments determined by the given lists. mapc is like mapcar except that the results of applying function are not accumulated; list1 is returned.
An error shall be signaled if function is not a function (error-id. domain-error). An error shall be signaled if any list is not a list (error-id. domain-error).
The calls to function proceed from left to right, so that if function has side-effects, it can rely upon being called first on all of the elements with index 0, then on all of those numbered 1, and so on.
mapcan
function
(mapcan function list+) => <list>
Successively applies the given function to sets of arguments determined by the given lists. mapcan is like mapcar, except that the results of applying function are combined into a list by the use of an operation that performs a destructive form of append rather than list.
An error shall be signaled if function is not a function (error-id. domain-error). An error shall be signaled if any list is not a list (error-id. domain-error).
The calls to function proceed from left to right, so that if function has side-effects, it can rely upon being called first on all of the elements with index 0, then on all of those numbered 1, and so on.
mapcar
function
(mapcar function list+) => <list>
Successively applies the given function to sets of arguments determined by the given lists. mapcar operates on successive elements of the lists. function is applied to the first element of each list, then to the second element of each list, and so on. The iteration terminates when the shortest list runs out, and excess elements in other lists are ignored. The value returned by mapcar is a list of the results of successive calls to function.
An error shall be signaled if function is not a function (error-id. domain-error). An error shall be signaled if any list is not a list (error-id. domain-error).
The calls to function proceed from left to right, so that if function has side-effects, it can rely upon being called first on all of the elements with index 0, then on all of those numbered 1, and so on.
mapcon
function
(mapcon function list+) => <list>
Successively applies the given function to sets of arguments determined by the given lists. mapcon is like maplist, except that the results of applying function are combined into a list by the use of an operation that performs a destructive form of append rather than list.
An error shall be signaled if function is not a function (error-id. domain-error). An error shall be signaled if any list is not a list (error-id. domain-error).
The calls to function proceed from left to right, so that if function has side-effects, it can rely upon being called first on all of the elements with index 0, then on all of those numbered 1, and so on.
mapl
function
(mapl function list+) => <list>
Successively applies the given function to sets of arguments determined by the given lists. mapl is like maplist except that the results of applying function are not accumulated; list1 is returned.
An error shall be signaled if function is not a function (error-id. domain-error). An error shall be signaled if any list is not a list (error-id. domain-error).
The calls to function proceed from left to right, so that if function has side-effects, it can rely upon being called first on all of the elements with index 0, then on all of those numbered 1, and so on.
maplist
function
(maplist function list+) => <list>
Successively applies the given function to sets of arguments determined by the given lists. maplist is like mapcar except that function is applied to successive sublists of the lists. function is first applied to the lists themselves, and then to the cdr of each list, and then to the cdr of the cdr of each list, and so on.
An error shall be signaled if function is not a function (error-id. domain-error). An error shall be signaled if any list is not a list (error-id. domain-error).
The calls to function proceed from left to right, so that if function has side-effects, it can rely upon being called first on all of the elements with index 0, then on all of those numbered 1, and so on.
max
function
(max x+) => <number>
The function max returns the greatest (closest to positive infinity) of its arguments. The comparison is done by >.
An error shall be signaled if any x is not a number (error-id. domain-error).
member
function
(member obj list) => <list>
If list contains at least one occurrence of obj (as determined by eql), the first sublist of list whose car is obj is returned. Otherwise, nil is returned. An error shall be signaled if list is not a list (error-id. domain-error).
min
function
(min x+) => <number>
The function min returns the least (closest to negative infinity) of its arguments. The comparison is done by <.
An error shall be signaled if any x is not a number (error-id. domain-error).
mod
function
(mod z1 z2) => <integer>
mod returns the remainder of the integer division of z1 by z2. The sign of the result is the sign of z2. The result lies between 0 (inclusive) and z2 (exclusive), and the difference of z1 and this result is divisible by z2 without remainder.
div and mod satisfy:
(= z1 (+ (* (div z1 z2) z2) (mod z1 z2)))
That is, the evaluation of the above form always return t.
An error shall be signaled if either z1 or z2 is not an integer (error-id. domain-error).
next-method-p
local-function
(next-method-p) => boolean
The next-method-p function can be used within the body of a method defined by a method-defining form to determine whether a next method exists. The next-method-p function takes no arguments and returns t or nil.
The functional binding of next-method-p is lexical within the body of the method-defining form; i.e., it is as if it were established by labels. The function object to which the binding refers has indefinite extent.
not
function
(not obj) => boolean
This predicate is the logical “not” (or “¬”). It returns t if obj is nil and nil otherwise. obj may be any ISLISP object.
nreverse
function
(nreverse list) => <list>
nreverse returns a list whose elements are those of the given list, but in reverse order. An error shall be signaled if list is not a list (error-id. domain-error).
The conses which make up the top level of the given list are permitted, but not required, to be side-effected in order to produce this new list. nreverse should never be called on a literal object.
null
function
(null obj) => boolean
Returns t if obj is nil; otherwise, returns nil. obj may be any ISLISP object.
numberp
function
(numberp obj) => boolean
Returns t if obj is a number (instance of class <number>); otherwise, returns nil. The obj may be any ISLISP object.
open-input-file
function
(open-input-file filename [element-class]) => <stream>
open-input-file opens a file for input only.
An error shall be signaled if filename is not a string. The corresponding file is opened in an implementation-defined way. These functions return an instance of the <stream> class connected to the file specified by filename.
The element-class can be either the class <character> (the default) or a positive integer that is a number of bits in a byte to be used for a binary stream. All implementations must support a value of 8 (denoting integer byte values from 0 to 255), but some implementations might support other byte sizes as well.
| When a binary stream is used, the order of bits within bytes and bytes within words (i.e., whether it is right to left or left to right) are each implementation defined. |
open-io-file
function
(open-io-file filename [element-class]) => <stream>
open-io-file opens a file for both input and output.
An error shall be signaled if filename is not a string. The corresponding file is opened in an implementation-defined way. These functions return an instance of the <stream> class connected to the file specified by filename.
The element-class can be either the class <character> (the default) or a positive integer that is a number of bits in a byte to be used for a binary stream. All implementations must support a value of 8 (denoting integer byte values from 0 to 255), but some implementations might support other byte sizes as well.
| When a binary stream is used, the order of bits within bytes and bytes within words (i.e., whether it is right to left or left to right) are each implementation defined. |
open-output-file
function
(open-output-file filename [element-class]) => <stream>
open-output-file opens a file for output only.
An error shall be signaled if filename is not a string. The corresponding file is opened in an implementation-defined way. These functions return an instance of the <stream> class connected to the file specified by filename.
The element-class can be either the class <character> (the default) or a positive integer that is a number of bits in a byte to be used for a binary stream. All implementations must support a value of 8 (denoting integer byte values from 0 to 255), but some implementations might support other byte sizes as well.
| When a binary stream is used, the order of bits within bytes and bytes within words (i.e., whether it is right to left or left to right) are each implementation defined. |
open-stream-p
function
(open-stream-p obj) => boolean
Returns t if obj is an open stream; otherwise, returns nil.
or
syntax
(or form*) => <object>
or is the sequential logical "or" (or "∨"). forms are evaluated from left to right until either one of them evaluates to a non-nil value or else none are left. If one of them evaluates to a non-nil value, then this non-nil value is returned, otherwise nil is returned. The form or is equivalent to the following:
(or) = 'nil (or form) = form (or form1 form2 … formn) = ((lambda (var) (if var var (or form2 … formn))) form1)
output-stream-p
function
(output-stream-p obj) => boolean
Returns t if obj is a stream that can handle output operations; otherwise, returns nil.
parse-error-expected-class
function
(parse-error-expected-class parse-error) => <class>
Returns the expected-class supplied as data when creating the parse-error. An error shall be signaled if parse-error is not a condition of class ** (error-id. domain-error).
parse-error-string
function
(parse-error-string parse-error) => <string>
Returns the string supplied as data when creating the parse-error. An error shall be signaled if parse-error is not a condition of class ** (error-id. domain-error).
parse-number
function
(parse-number string) => <number>
The characters belonging to string are scanned (as if by read) and if the resulting lexeme is the textual representation of a number, the number it represents is returned.
An error shall be signaled if string is not a string (error-id. domain-error). An error shall be signaled if string is not the textual representation of a number (error-id. cannot-parse-number).
preview-char
function
(preview-char [input-stream [eos-error-p [eos-value]]]) => <object>
Returns the next character of input-stream, if any. The character is not consumed; the next attempt to peek at or read a character from the stream sees that same character.
See §27.1 for information about how input-stream, eos-error-p, and eos-value are treated.
print-stacktrace
function
(print-stacktrace stream condition) => <null>
Prints given condition's stacktrace to stream. Uses active *stacktrace-formatter*.
probe-file
function
(probe-file filename) => boolean
Returns t if the file specified by filename exists; otherwise, returns nil. An error shall be signaled if filename is not a string (error-id. domain-error).
progn
syntax
(progn form*) => <object>
This special form allows a series of forms to be evaluated, where normally only one could be used.
The result of evaluation of the last form of form* is returned. All the forms are evaluated from left to right. The values of all the forms but the last are discarded, so they are executed only for their side-effects. progn without forms returns nil.
property
function
(property symbol property-name [obj]) => <object>
Returns the value of the property named property-name associated with the symbol symbol. If symbol has no property named property-name, obj (which defaults to nil) is returned.
An error shall be signaled if either symbol or property-name is not a symbol (error-id. domain-error). obj may be any ISLISP object
property
setf
(setf (property symbol property-name) obj) => <object>
Causes obj to be the new value of the property named property-name asssociated with the symbol symbol. If the property named property-name already exists, its corresponding property value is replaced; otherwise, a new property is created. obj is returned.
An error shall be signaled if either symbol or property-name is not a symbol (error-id. domain-error). obj may be any ISLISP object
provides
syntax
(provides symbol*)
Exports functions / macros / values bound to symbol to be visible in other modules that requires this module.
quote
syntax
(quote obj) => <object>
A quoted expression denotes a reference to an object. This notation is used to include any object in an ISLISP text.
The character ' (apostrophe or single quote) is syntax for quotation. That is, (quote a) = *'*a.
The result of the evaluation of the quote special form is obj.
quotient
function
(quotient dividend divisor+) => <number>
The function quotient, given two arguments dividend and divisor, returns the quotient of those numbers. The result is an integer if dividend and divisor are integers and divisor evenly divides dividend, otherwise it will be a float.
Given more than two arguments, quotient operates iteratively on each of the divisor1 … divisorn as in dividend / divisor1 / … / divisorn. The type of the result follows from the two-argument case because the three-or-more-argument quotient can be defined as follows:
(quotient dividend divisor1 divisor2 …) = (quotient (quotient dividend divisor1) divisor2 …)
An error shall be signaled if dividend is not a number (error-id. domain-error). An error shall be signaled if any divisor is not a number (error-id. domain-error). An error shall be signaled if any divisor is zero (error-id. division-by-zero).
read
function
(read [input-stream [eos-error-p [eos-value]]]) => <object>
The function read returns the ISLISP object that is created as the result of reading its textual representation from the stream input-stream.
See §27.1 for information about how input-stream, eos-error-p, and eos-value are treated.
read-byte
function
(read-byte input-stream [eos-error-p [eos-value]]) => <integer>
Reads a byte from the input-stream and returns it. The number of bits in a byte is determined by the stream element type of the input-stream; see open-input-file.
See §27.1 for information about how input-stream, eos-error-p, and eos-value are treated.
read-char
function
(read-char [input-stream [eos-error-p [eos-value]]]) => <object>
read-char reads a single character from input-stream and returns the corresponding character object.
See §27.1 for information about how input-stream, eos-error-p, and eos-value are treated.
read-line
function
(read-line [input-stream [eos-error-p [eos-value]]]) => <object>
Reads a line of characters from input-stream and returns them as a string (without the newline character at the end of the line). If an end-of-stream is reached before the next newline character and a non-empty line has been read prior to the end-of-stream, that line is returned.
See §27.1 for information about how input-stream, eos-error-p, and eos-value are treated.
reciprocal
function
(reciprocal x) => <number>
The function reciprocal returns the reciprocal of its argument x; that is, 1/x. An error shall be signaled if x is zero (error-id. division-by-zero).
remove-property
function
(remove-property symbol property-name) => <object>
Removes the property property-name associated with symbol and returns the property value of the removed property if there is such a property. If there is no such property, nil is returned.
An error shall be signaled if either symbol or property-name is not a symbol (error-id. domain-error).
report-condition
generic-function
(report-condition condition stream) => <condition>
Presents a natural language description of condition to stream. This generic function may be specialized for user-defined condition classes.
requires
syntax
(require path)
Imports module from path (which must be a string). path is resolved relative set of active source roots.
return-from
syntax
(return-from name result-form => nil
Returns from named block. See block for details.
reverse
function
(reverse list) => <list>
Returns a list whose elements are those of the given list, but in reverse order. An error shall be signaled if list is not a list (error-id. domain-error).
For reverse, no side-effect to the given list occurs. The resulting list is permitted but not required to share structure with the input list.
round
function
(round x) => <integer>
Returns the integer nearest to x. If x is exactly halfway between two integers, the even one is chosen. An error shall be signaled if x is not a number (error-id. domain-error).
set-aref
function
(set-aref obj basic-array z*) => <object>
Replaces the object obtainable by aref with obj. The returned value is obj. The constraints on the basic-array and the sequence of indices z is the same as for aref.
set-car
function
(set-car obj cons) => <object>
Updates the left component of cons with obj. The returned value is obj. An error shall be signaled if cons is not a cons (error-id. domain-error). obj may be any ISLISP object.
set-cdr
function
(set-cdr obj cons) => <object>
Updates the right component of cons with obj. The returned value is obj . An error shall be signaled if cons is not a cons (error-id. domain-error). obj may be any ISLISP object.
set-documentation
function
(set-documentation docvalue name-space symbol) => <object>
Sets documentation value for given name-space and symbol in current module. See documentation for details about documentation format.
Returns previously stored documentation entry.
set-dynamic
syntax
(set-dynamic form var) => <object>
This special form denotes an assignment to a dynamic variable. This form can appear anywhere that (dynamic var) can appear.
form is evaluated and the result of the evaluation is used to change the dynamic binding of var.
An error shall be signaled if var has no dynamic value (error-id. unbound-variable). setf of dynamic can be used only for modifying bindings, and not for establishing them.
set-elt
function
(set-elt obj sequence z) => <object>
Replaces the object obtainable by elt with obj. The returned value is obj.
An error shall be signaled if z is an integer outside of the valid range of indices (error-id. index-out-of-range). An error shall be signaled if sequence is not a basic-vector or a list or if z is not an integer (error-id. domain-error). obj may be any ISLISP object.
set-file-position
function
(set-file-position stream z) => <integer>
Attempts to change the file position (see file-position) of the stream stream to z . If it is not possible to move to the exact position z , some implementation-defined motion within the file might still be performed. The value returned is the new file position, which might or might not be z.
An error shall be signaled if stream is not a stream to or from a file, or if z is not a non-negative integer (error-id. domain-error).
set-garef
function
(set-garef obj general-array z*) => <object>
Replace the object obtainable by garef with obj. The returned value is obj. The constraints on the general-array and the sequence of indices z is the same as for garef.
set-property
function
(set-property obj symbol property-name) => <object>
Causes obj to be the new value of the property named property-name asssociated with the symbol symbol. If the property named property-name already exists, its corresponding property value is replaced; otherwise, a new property is created. obj is returned.
An error shall be signaled if either symbol or property-name is not a symbol (error-id. domain-error). obj may be any ISLISP object
setf
syntax
(setf place form) => <object>
This macro is used for generalized assignment.
setf takes a place and stores in this place the result of the evaluation of the form form. The place form is not evaluated as a whole entity, but subforms of place are evaluated sequentially from left to right to determine a place to be assigned a value. When place is denoted by an identifier, setf behaves exactly as setq. The returned value is the result of the evaluation of form. The valid places for the setf special form are as follows:
variables |
var |
dynamic bindings |
(dynamic var) |
the components of a basic-array |
(aref basic-array z1 … zn) |
the components of a general array |
(garef general-array z1 … zn) |
the components of a list |
(elt list z) |
the components of a vector |
(elt basic-vector z) |
the left component of a cons |
(car cons) |
the right component of a cons |
(cdr cons) |
a property of a symbol |
(property symbol property) |
a slot of an instance of a class |
(reader-function-name instance) |
A place can also be a macro form that expands (during preparation for execution) into a place or a function application form with operator op for which setf is defined or for which a generic function named (setf op) has been defined. In these last two cases, that function will receive as arguments the new value to be assigned followed by the objects that resulted from evaluating the arguments of the function application form.
setq
syntax
(setq var form) => <object>
This form represents an assignment to the variable denoted by the identifier. In consequence, the identifier may designate a different object than before, the value of form.
The result of the evaluation of form is returned. This result is used to modify the variable binding denoted by the identifier var (if it is mutable). setq can be used only for modifying bindings, and not for establishing a variable. The setq special form must be contained in the scope of var , established by defglobal, let, let*, for, or a lambda expression.
signal-condition
function
(signal-condition condition continuable) => <object>
Invokes the condition handling system on condition.
If continuable is nil, the results of attempting to “continue” (see continue-condition) are not defined except that the call to signal-condition will not return normally.
If continuable is not nil, it will be possible to return from the call to signal-condition (see continue-condition). In this case, the specific value of continuable may be a string indicating the effect of continuing, or it may be the symbol t, indicating that an implementation-defined string such as "Continue with no special action." is to be used.
simple-error-format-arguments
function
(simple-error-format-arguments simple-error) => <list>
Returns the format-arguments supplied as data when creating the simple-error. An error shall be signaled if simple-error is not a condition of class <simple-error> (error-id. domain-error).
simple-error-format-string
function
(simple-error-format-string simple-error) => <string>
Returns the format-string supplied as data when creating the simple-error. An error shall be signaled if simple-error is not a condition of class <simple-error> (error-id. domain-error).
sin
function
(sin x) => <number>
The function sin returns the sine of x .x must be given in radians.
An error shall be signaled if x is not a number (error-id. domain-error).
sinh
function
(sinh x) => <number>
The function sinh returns the hyperbolic sine of x.
An error shall be signaled if x is not a number (error-id. domain-error).
sqrt
function
(sqrt x) => <number>
Returns the non-negative square root of x. An error shall be signaled if x is not a non-negative number (error-id. domain-error).
standard-input
function
(standard-input) => <stream>
The function standard-input returns the stream used as the default stream for input functions.
The value returned by this function is initially implementation-defined, but can be dynamically bound; see with-standard-input.
standard-output
function
(standard-output) => <stream>
The function standard-output returns the stream used as the default stream for output functions.
The value returned by this function is initially implementation-defined, but can be dynamically bound; see with-standard-output.
stream-error-stream
function
(stream-error-stream stream-error) => <stream>
Returns the stream supplied as data when creating the stream-error. An error shall be signaled if stream-error is not a condition of class <stream-error> (error-id. domain-error).
stream-ready-p
function
(stream-ready-p input-stream) => boolean
Returns t if an attempt to obtain the next element from the stream will not cause the processor to have to wait; otherwise, returns nil. An error shall be signaled if stream is not a stream that can handle input operations (error-id. domain-error).
streamp
function
(streamp obj) => boolean
Returns t if obj is a stream (instance of class <stream>); otherwise, returns nil. obj may be any ISLISP object. streamp is unaffected by whether its argument, if an instance of the class <stream>, is open or closed.
string-append
function
(string-append string*) => <string>
Returns a single string containing a sequence of characters that results from appending the sequences of characters of each of the strings, or "" if given no strings. An error shall be signaled if any string is not a string (error-id. domain-error).
This function does not modify its arguments. It is implementation defined whether and when the result shares structure with its string arguments.
An error shall be signaled if the string cannot be allocated (error-id. cannot-create-string).
string-index
function
(string-index substring string [start-position]) => <object>
Returns the position of the given substring within string. The search starts from the position indicated by start-position (which is 0-based and defaults to 0). The value returned if the search succeeds is an offset from the beginning of the string, not from the starting point. If that substring does not occur in the string, nil is returned. Presence of the substring is done by sequential use of char= on corresponding elements of the two strings.
An error shall be signaled if either substring or string is not a string (error-id. domain-error).
string/=
function
(string/= string1 string2) => quasi-boolean
Two strings are string/= if and only if they are not string=. If the test is satisfied, an implementation-defined non-nil value is returned; otherwise, nil is returned.
An error shall be signaled if either string1 or string2 is not a string (error-id. domain-error).
string<
function
(string< string1 string2) => quasi-boolean
The function string< tests whether string1 is less than string2.
The ordering used is based on character comparisons.
Two strings string1 and string2 are in order (string<) if in the first position in which they differ the character of string1 is char< the corresponding character of string2, or if the string1 is a proper prefix of string2 (of shorter length and matching in all the characters of string1).
If the test is satisfied, an implementation-defined non-nil value is returned; otherwise, nil is returned.
An error shall be signaled if either string1 or string2 is not a string (error-id. domain-error).
string<=
function
(string<= string1 string2) => quasi-boolean
Two strings are string⇐ if they are either string< or they are string=.
If the test is satisfied, an implementation-defined non-nil value is returned; otherwise, nil is returned.
An error shall be signaled if either string1 or string2 is not a string (error-id. domain-error).
string=
function
(string= string1 string2) => quasi-boolean
Two strings are string= if they are of the same length, l , and if for every i, where 0 ≤ i < l, (char= (elt string1 i) (elt string2 i)) holds.
If the test is satisfied, an implementation-defined non-nil value is returned; otherwise, nil is returned.
An error shall be signaled if either string1 or string2 is not a string (error-id. domain-error).
string>
function
(string> string1 string2) => quasi-boolean
Two strings are string> if and only if they are not string⇐.
If the test is satisfied, an implementation-defined non-nil value is returned; otherwise, nil is returned.
An error shall be signaled if either string1 or string2 is not a string (error-id. domain-error).
string>=
function
(string>= string1 string2) => quasi-boolean
Two strings are string>= if and only if they are not string<.
If the test is satisfied, an implementation-defined non-nil value is returned; otherwise, nil is returned.
An error shall be signaled if either string1 or string2 is not a string (error-id. domain-error).
stringp
function
(stringp obj) => boolean
Returns t if obj is a string (instance of class <string>); otherwise, returns nil. obj may be any ISLISP object.
subclassp
function
(subclassp class1 class2) => boolean
Returns t if the class class1 is a subclass of the class class2; otherwise, returns nil. An error shall be signaled if either class1 or class2 is not a class object (error-id. domain-error).
subseq
function
(subseq sequence z1 z2) => <sequence>
Given a sequence sequence and two integers z1 and z2 satisfying 0 ≤ z1 ≤ z2 ≤ (length sequence), this function returns the subsequence of length z2 − z1, containing the elements with indices from z1 (inclusive) to z2 (exclusive). The subsequence is newly allocated, and has the same class as sequence.
An error shall be signaled if the requested subsequence cannot be allocated (error-id. cannot-create-sequence). An error shall be signaled if z1 or z2 are outside of the bounds mentioned (error-id. index-out-of-range). An error shall be signaled if sequence is not a basic-vector or a list, or if z1 is not an integer, or if z2 is not an integer (error-id. domain-error).
symbolp
function
(symbolp obj) => boolean
Returns t if obj is a symbol (instance of class <symbol>); otherwise, returns nil. The obj may be any ISLISP object.
t
constant
t => <symbol>
t is a named constant whose value is the symbol t itself. nil is a named constant whose value is the symbol nil itself.
tagbody
syntax
(tagbody {tagbody-tag | form}*) => <object>
tagbody executes the forms sequentially from left to right, discarding their values. If the execution of the last form completes normally, nil is returned by the tagbody special form.
The series of tagbody-tags and forms is collectively referred to as the body of a tagbody form. An identifier tagbody-tag that appears at toplevel of the body denotes a tagbody tag that can be used with go to transfer control to that point in the body. Any compound form that appears is taken as a form. Literals are not permitted at the toplevel of a tagbody. No tagbody-tag may appear more than once in the tags in the body.
The namespace used for tagbody tags is distinct from that used for block tags.
At any point lexically contained in the tagbody a form (go tag) can be used to transfer control to a tag tag that appears among the tagbody-tags, except where a tag is shadowed according to the lexical principle (see §11.1).
A tagbody-tag established by tagbody has lexical scope, but the point in the program to which it refers has dynamic extent. Once tagbody has been exited, it is no longer valid to use go to transfer to any tag in its body.
The determination of which elements of the body are tagbody-tags and which are forms is made prior to any macro expansion of that element. If form is a macro form and its macro expansion is a symbol or literal, that atom is treated as a form, not as a tagbody-tag.
It is a violation if a tagbody tag is other than an identifier. See §14.7.2 for other errors.
| As a stylistic matter, programmers are not encouraged to use tagbody and go in everyday programming. The primary uses for which these forms are intended are for implementing other control abstractions (using macros), and for the occassional real-world situation that uses unstructured imperative transfer of control (such as a finite state machine). |
tan
function
(tan x) => <number>
The function tan returns the tangent of x. x must be given in radians.
An error shall be signaled if x is not a number (error-id. domain-error).
tanh
function
(tanh x) => <number>
The function tanh returns the hyperbolic tangent of x.
An error shall be signaled if x is not a number (error-id. domain-error).
the
syntax
(the class-name form) => <object>
This form evaluates form. If form returns, the returned value is returned by the the form. In addition, this form specifies that the value of form is of the class specified by class-name (which must be the name of an existing class).
The consequences are undefined if the value of form is not of the class or a subclass of the class designated by class-name.
throw
syntax
(throw tag-form result-form) => nil
The special forms catch and throw provide a facility for programming of structured non-local dynamic exits. A catch form and a throw form are said to correspond if the tag-form of the catch and the tag-form of the throw evaluate to the same object, a catch tag. A catch tag may be any object other than a number or a character; the comparison of catch tags uses eq.
The catch special form first evaluates the tag-form to produce a catch tag, and then executes each form sequentially from left to right. If execution of the forms finishes normally, whatever is returned by the last form is returned by the catch form.
Prior to execution of the forms of a catch form C0, an association between the catch tag T0 and the executing form C0 is dynamically established, upon exit from C0, the association is disestablished. If there was an outer association for the same catch tag T0, it is hidden during the execution of C0's forms; only the most recently established (i.e., innermost) association for T0 is ever visible.
If a throw special form is executed, it evaluates the tag-form producing a catch tag T1, and then evaluates the result-form producing a result R1. If there is a corresponding association between T1 and some catch form C1 that is executing, R1 is immediately returned as the value of C1. The throw form can be anywhere in the entire current toplevel scope; it need not be lexically contained within C1.
An error shall be signaled if there is no outstanding catcher for a T1 (error-id. control-error). See §14.7.2 for other errors.
trace
syntax
(trace expr) => <object>
"print" debugging helper. Outputs expr and it’s evaluated result to stdout. Returns evaluated result.
truncate
function
(truncate x) => <integer>
Returns the integer between 0 and x (inclusive) that is nearest to x. That is, x is truncated towards zero. An error shall be signaled if x is not a number (error-id. domain-error).
undefined-entity-name
function
(undefined-entity-name undefined-entity) => <symbol>
Returns the name supplied as data when creating the undefined-entity. An error shall be signaled if undefined-entity is not a condition of class <undefined-entity> (error-id. domain-error).
undefined-entity-namespace
function
(undefined-entity-namespace undefined-entity) => <symbol>
Returns the namespace supplied as data when creating the undefined-entity. An error shall be signaled if undefined-entity is not a condition of class <undefined-entity> (error-id. domain-error).
The result of undefined-entity-namespace will be one of the symbols variable, dynamic-variable, function, or class.
unwind-protect
syntax
(unwind-protect form cleanup-form*) => <object>
unwind-protect first evaluates form. Evaluation of the cleanup-forms always occurs, regardless of whether the exit is normal or non-local.
If the form exits normally yielding a value R, then if all of the cleanup-forms exit normally the value R is returned by the unwind-protect form.
If a non-local exit from form occurs, then the cleanup-forms are executed as part of that exit, and then if all of the cleanup-forms exit normally the original non-local exit continues.
The cleanup-forms are evaluated from left to right, discarding the resulting values. If execution of the cleanup-forms finishes normally, exit from the unwind-protect form proceeds as described above. It is permissible for a cleanup-form to contain a non-local exit from the unwind-protect form, subject to the following constraint:
An error shall be signaled if during execution of the cleanup-forms of an unwind-protect form, a non-local exit is executed to a destination which has been marked as invalid due to some other non-local exit that is already in progress (see §14.7.1) (error-id. control-error).
| Because ISLISP does not specify an interactive debugger, it is unspecified whether or how error recovery can occur interactively if programmatic handling fails. The intent is that if the ISLISP processor does not terminate abnormally, normal mechanisms for non-local exit (return-from, throw, or go) would be used as necessary and would respect these cleanup-forms. |
vector
function
(vector obj*) => <general-vector>
Returns a new general-vector whose elements are its obj arguments. The length of the newly created vector is, therefore, the number of objs passed as arguments. The vector is indexed by integers ranging from 0 to dimension−1. An error shall be signaled if the requested vector cannot be allocated (error-id. cannot-create-vector). Each obj may be any ISLISP object.
while
syntax
(while test-form body-form*) => <null>
Iterates while the test-form returns a true value. Specifically:
-
test-form is evaluated, producing a value Vt.
-
If Vt is nil, then the while form immediately returns nil.
-
Otherwise, if Vt is non-nil, the forms body-form* are evaluated sequentially (from left to right).
-
Upon successful completion of the body-forms*, the while form begins again with step 1.
with-error-output
syntax
(with-error-output stream-form form*) => <object>
This special form first evaluate its stream-form argument to produce a stream s and then evaluate its body forms in a dynamic environment where the function error-output returns the stream s. The returned value is the result of the evaluation of the last form of its body (or nil if there is none).
with-handler
syntax
(with-handler handler form*) => <object>
Evaluates handler, which must yield a function (called the “handler function”). The handler function is established as active handler (see §29.2) and then the forms are executed. If execution of forms finishes normally, the value of the last form (or nil if there are no forms) is returned.
with-open-input-file
syntax
(with-open-input-file (name filename [element-class]) form*) => <object>
This special form opens a stream to a file (using open-input-file), evaluates the forms, closes the file, and returns the value returned by the last form (or nil if there are no forms).
The filename and element-class are evaluated and passed as arguments to the appropriate file-opening function. The stream created by opening the file is bound to the variable named by name (as if a let was used), so the identifier name can be used to refer to the stream.
The stream is closed on exit, whether or not exit from these special forms is normal. For this reason, these special forms are usually preferred over the corresponding functions for opening and closing files.
with-open-io-file
syntax
(with-open-io-file (name filename [element-class]) form*) => <object>
This special form opens a stream to a file (using open-io-file), evaluates the forms, closes the file, and returns the value returned by the last form (or nil if there are no forms).
The filename and element-class are evaluated and passed as arguments to the appropriate file-opening function. The stream created by opening the file is bound to the variable named by name (as if a let was used), so the identifier name can be used to refer to the stream.
The stream is closed on exit, whether or not exit from these special forms is normal. For this reason, these special forms are usually preferred over the corresponding functions for opening and closing files.
with-open-output-file
syntax
(with-open-output-file (name filename [element-class]) form*) => <object>
This special form opens a stream to a file (using open-output-file), evaluates the forms, closes the file, and returns the value returned by the last form (or nil if there are no forms).
The filename and element-class are evaluated and passed as arguments to the appropriate file-opening function. The stream created by opening the file is bound to the variable named by name (as if a let was used), so the identifier name can be used to refer to the stream.
The stream is closed on exit, whether or not exit from these special forms is normal. For this reason, these special forms are usually preferred over the corresponding functions for opening and closing files.
with-standard-input
syntax
(with-standard-input stream-form form*) => <object>
This special form first evaluate its stream-form argument to produce a stream s and then evaluate its body forms in a dynamic environment where the function standard-input returns the stream s. The returned value is the result of the evaluation of the last form of its body (or nil if there is none).
with-standard-output
syntax
(with-standard-output stream-form form*) => <object>
This special form first evaluate its stream-form argument to produce a stream s and then evaluate its body forms in a dynamic environment where the function standard-output returns the stream s. The returned value is the result of the evaluation of the last form of its body (or nil if there is none).
write-byte
function
(write-byte z output-stream) => <integer>
Writes z to the output-stream and returns it. An error shall be signaled if z is not an integer in the range appropriate to the stream element type of output-stream or if output-stream is not a stream capable of handling output operations (error-id. domain-error).