LISP: ED
C: Ed
min args: 0
max args: 1
[F][CLTL 25]
SYNOPSIS:
ed &optional x
DESCRIPTION:
This function invokes the editor whose name is specified by the name-editor function.
(ed)
with no arguments edits the last file edited, or if there has been no editing activity yet in the session, invokes the editor with no arguments.SEE ALSO:
run, name-editor.
LISP: EIGHTH
C: Leighth
min args: 1
max args: 1
[F][CLTL 15]
SYNOPSIS:
eighth list
DESCRIPTION:
See first.
LISP: ELT
C: Lelt
min args: 2
max args: 2
[F][CLTL 14]
SYNOPSIS:
elt sequence index
DESCRIPTION:
This returns the element of sequence specified by index, which must be a non-negative integer less than the length of the sequence as returned by length. The first element of a sequence has index 0.
(Note that elt observes the fill pointer in those vectors that have fill pointers. The array-specific function aref may be used to access vector elements that are beyond the vector's fill pointer.)
setf
may be used with elt to destructively replace a sequence element with a new value. The setf method for elt can be found in init0.lsp.
LISP: ENCODE-UNIVERSAL-TIME
C: EUT
min args: 6
max args: 7
[F][CLTL]
SYNOPSIS:
encode-universal-time second minute hour date month year
&optional time-zone
DESCRIPTION:
The time specified by the given Decoded Time format components is encoded into Universal Time and returned. Time-zone, if not specified, defaults to the default time-zone adjusted for daylight savings time. If a time-zone is specified, no daylight savings time handling occurs.
BUGS:
Specifying universal times using encode-universal time for dates prior to 1-1-1970 will produce spurious results.
NOTES:
See time functions for a description of Decoded Time and Universal Time format, as well as an explanation of how to set the default time-zone.
LISP: ENDP
C: Lendp
min args: 1
max args: 1
[F][CLTL 15]
SYNOPSIS:
endp object
DESCRIPTION:
The predicate endp is the recommended way to test for the end of a list. It is false of conses, true of nil, and an error for all other arguments.
LISP: EQ
C: Leq
min args: 2
max args: 2
[F][CLTL 6]
SYNOPSIS:
eq x y
DESCRIPTION:
(eq
x y) is true if and only if x and y are the same identical object. (Implementationally, x and y are usually eq if and only if they address the same identical virtual memory location.)It is important to note that objects that print the same are not necessarily eq to each other.
Symbols with the same print name usually are eq to each other because they have been interned into the same package and hence are stored at identical addresses. However, numbers with the same value need not be eq, and two similar lists are normally not eq.
EXAMPLES:
(eq 'a 'b) is false.
(eq ('a 'a) is true.
(eq 3 3) is true.
(eq 3 3.0) is false.
(eq 3.0 3.0) is false. (= 3.0 3.0) is true.
(eq (cons 'a 'b) (cons 'a 'c)) is false.
(eq (cons 'a 'b) (cons 'a 'b)) is false.
(eq '(a . b) '(a . b)) is false.
(progn (setq x (cons 'a 'b)) eq x x)) is true.
(progn (setq x '(a . b)) (eq x x)) is true.
(eq #\A #\A) is true.
(eq "Foo" "Foo" is false.
(eq "Foo" (copy-seq "Foo")) is false.
(eq "FOO" "foo") is false.
NOTES:
In Common LISP, unlike some other LISP dialects, the implementation is permitted to make "copies" of characters and numbers at any time. This permission is granted because it allows tremendous performance improvements in many common situations. The net effect is that Common LISP makes no guarantee that eq will be true even when both its arguments are "the same thing" if that thing is a character or number. For example:
(let ((x 5)) (eq x x)) is true.
The predicate eql is the same as eq, except that if the arguments are characters or numbers of the same type then their values are compared. Thus eql tells whether two objects are conceptually the same, whereas eq tells whether two objects are implementationally identical. It is for this reason that eql, not eq, is the default comparison predicate for the :test and :test-not keywords defined for sequence and list functions.
Implementation note: eq simply compares the two given virtual addresses, so any kind of object that is represented in an "immediate" fashion will indeed have like-valued instances satisfy eq. In this implementation, for example, fixnums and characters happen to "work." However, no program should depend on this, as other implementations of Common LISP might not use an immediate representation for these data types.
LISP: EQL
C: Leql
min args: 2
max args: 2
[F][CLTL 6]
SYNOPSIS:
eql x y
DESCRIPTION:
The eql precicate is true if its arguments are eq, or if they are numbers of the same type with the same value, or if they are character objects that represent the same character.
EXAMPLES:
(eql 'a 'b) is false.
(eql 'a 'a) is true.
(eql 3 3) is true.
(eql 3 3.0) is false.
(eql 3.0 3.0) is true.
(eql (cons 'a 'b) cons 'a 'c)) is false.
(eql (cons 'a 'b) cons 'a 'b)) is false.
(eql '(a . b) '(a . b)) is false.
(progn (setq x (cons 'a 'b)) (eql x x)) is true.
(progn (setq x '(a . b)) (eql x x)) is true.
(eql #\A #\A) is true.
(eql "Foo" "Foo") is false.
(eql "Foo" (copy-seq "Foo")) is false.
(eql "FOO" "foo") is false.
NOTES:
This implementation represents 0.0 and -0.0 identically. Thus (eql 0.0 - 0.0 ) is true.
Note that = must be used to compare two floating point values; This implementation checks whether they diverge by some small amount.
The case of (eql "Foo" "Foo") is discussed above in the description of eq. While eql compares the values of numbers and character, it does not compare the contents of strings. To compare the characters of two strings, one should use equal, equalp, string=, or string-equal.
See Also:
eql
(typespec)
LISP: EQL (typespec)
[Typespec][CLTL2 4]
SYNOPSIS:
eql object
DESCRIPTION:
This type specifier appears only in type lists and denotes the set of exactly one object. This type specifier was introduced by ANSI and is supported in this implementation.
LISP: EQUAL
C: Lequal
min args: 2
max args: 2
[F][CLTL 6]
SYNOPSIS:
equal x y
DESCRIPTION:
The equal predicate is true if its arguments are structurally similar (isomorphic) objects. A rough rule of thumb is that two objects are equal if and only if their printed representations are the same. Numbers and characters are compared as for eql. Symbols are compared as for eq. This method of comparing symbols can violate the rule of thumb for equal and printed representations, but only in the infrequently occurring case of two distinct symbols with the same print name.
Certain objects that have components are equal if they are of the same type and corresponding components are equal. This test is implemented in a recursive manner and may fail to terminate for circular structures.
For conses, equal is defind recursively as the two car's being equal and the two cdr's being equal.
Two arrays are equal only if they are eq, with one exception: Strings and bit-vectors are compared element-by-element. If either argument has a fill pointer, the fill pointer limits the number of elements examined by equal. Uppercase and lowercase letters in strings are considered by equal to be distinct. (In contrast, equalp ignores case distinctions in strings.)
EXAMPLES:
(equal 'a 'b) is false.
(equal 'a 'a) is true.
(equal 3 3) is true.
(equal 3 3.0) is false.
(equal 3.0 3.0) is true.
(equal (cons 'a 'b) (cons 'a 'c)) is false.
(equal (cons 'a 'b) (cons 'a 'b)) is true.
(equal '(a . b) '(a . b)) is true.
(progn (setq x (cons 'a 'b)) (equal x x)) is true.
(progn (setq x '(a . b)) (equal x x)) is true.
(equal #\A #\A) is true.
(equal "Foo" "Foo") is true.
(equal "Foo" (copy-seq "Foo")) is true.
(equal "FOO" "foo") is false.
NOTES:
To compare a tree of conses, using eql (or any other desired predicate) on each leaf, use tree-equal.
LISP: EQUALP
C: Lequalp
min args: 2
max args: 2
[F][CLTL 6]
SYNOPSIS:
equalp x y
DESCRIPTION:
Two objects are equalp if they are equal; if they are characters and satisfy char-equal, which ignores alphabetic case and certain other attributes of characters; if they are numbers and have the same numerical value, even if they are of different types; or if they have components that are all equalp.
Objects that have components are equalp if they are of the same type and corresponding components are equalp. This test is implemented in a recursive manner and may fail to terminate for circular structures. For conses, equalp is defind recursively as the two car's being equalp and the two cdr's being equalp.
Two arrays are equalp if and only if they have the same number of dimensions, the dimensions match, and the corresponding components are equalp. The specializations need not match; for example, a string and a general array that happens to contain the same characters will be equalp (though definitely not equal). If either argument has a fill pointer, the fill pointer limits the number of elements examined by equalp. Because equalp performs element-by-element comparisons of strings and ignores the alphabetic case of characters, case distinctions are therefore also ignored when equalp compares strings. Two symbols can be equalp only if they are eq, that is, the same identical object.
EXAMPLES:
(equalp 'a 'b) is false.
(equalp 'a 'a) is true.
(equalp 3 3) is true.
(equalp 3 3.0) is true.
(equalp 3.0 3.0) is true.
(equalp (cons 'a 'b) (cons 'a 'c)) is false.
(equalp (cons 'a 'b) (cons'a 'b)) is true.
(equalp '(a . b) '(a . b)) is true.
(progn (setq x (cons 'a 'b)) (equalp x x)) is true.
(progn (setq x '(a . b)) (equalp x x)) is true.
(equalp #\A #\A) is true.
(equalp "Foo" "Foo") is true.
(equalp "Foo" (copy-seq "Foo")) is true.
(equalp "FOO" "foo") is true.
LISP: ERROR
C: L_Error
min args: 1
max args: -1
[F][CLTL 24]
SYNOPSIS:
error format-string &rest args
DESCRIPTION:
The error function signals a fatal error.
First, the format string and its associated arguments are printed to the *error-output* stream as if by format.
After the format string is printed, the currently running LISP program terminates and the user is returned to the top level of LISP.
LISP: *ERROR-OUTPUT*
[V][CLTL 21]
SYNOPSIS:
*error-output*
DESCRIPTION:
The value of *error-output* is a stream to which error messages should be sent. Normally this is the same as *standard-output*, but *standard-output* might be bound to a file and *error-output* left going to the terminal or a separate file of error messages.
LISP: EVAL
C: L_Eval
min args: 1
max args: 1
[F][CLTL 20]
SYNOPSIS:
eval form
DESCRIPTION:
The form is evaluated in the current dynamic environment and a null lexical environment. Whatever results from the evaluation is returned from the call to eval.
Note that when you write a call to eval two levels of evaluation occur on the argument form you write. First the argument form is evaluated, as for arguments to any function, by the usual argument evaluation mechanism (which involves an implicit use of eval). Then the argument is passed to the eval function, where another evaluation occurs. For example:
(eval (list 'cdr (car '((quote (a . b)) c)))) => b
The argument form (list 'cdr (car '((quote (a . b)) c))) is evaluated in the usual way to produce the argument (cdr (quote (a . b))); this is then given to eval because eval is being called explicitly, and eval evaluates its argument (cdr (quote (a . b))) to produce b.
If all that is required for some application is to obtain the current dynamic value of a given symbol, the function symbol-value may be more efficient than eval.
LISP: EVAL-WHEN
C: SFCEvalWhen, EvalWhen
min args: 1
max args: -1
[S][CLTL 5]
SYNOPSIS:
eval-when ({situation}*) {form}*
DESCRIPTION:
The eval-when special form specifies that a form or forms is to be executed only at a specific time.
The body of an eval-when form is processed as an implicit progn, but only in the situations listed.
The situation argument, which is not evaluated, specifies the time and must be a a list consisting of one or more of the symbols compile, load or eval.
The first means at compile time, the second means only at load time, the third means when the forms are interpreted but not compiled.
In Star Sapphire, all forms are compiled by the incremental compiler when they are read irregardless of their source. Compile time in Star Sapphire LISP specifically means when a form is compiled from a LISP source file on disk, the name of the file having been given to the function compile-file. In brief, Star Sapphire compile time begins when compile-file is invoked and ends when it terminates.
Similarly, in Star Sapphire, load time refers to when the load function begins and ends when it terminates. The file being loaded can be a LISP source file or a previously compiled file in the fastload format.
Eval
time means all other times, that is, when forms are being typed by the user at the LISP prompt.NOTES:
The uses of eval-when are relatively esoteric. The usefulness of this is to avoid re-evaluating code that should only be run once if you are interfacing both with the compiler and the load function. These situations are hard to give a simple example of, but will be self apparent when they arise.
LISP: EVENP
C: Levenp
min args: 1
max args: 1
[F][CLTL 12]
SYNOPSIS:
evenp integer
DESCRIPTION:
This predicate is true if the argument integer is even (divisible by two), and otherwise is false. It is an error if the argument is not an integer.
LISP: EVERY
C: Levery
min args: 2
max args: -1
[F][CLTL 14]
SYNOPSIS:
every predicate sequence &rest more-sequences
DESCRIPTION:
This is a predicate which takes as many arguments as there are sequences provided. The predicate is first applied to the elements with index 1, and so on, until a termination criterion is met or the end of the shortest of the sequences is reached.
If the predicate has side effects, it can count on being called first on all the elements numbered 0, then on all those numbered 1, and so on.
every
returns nil as soon as any invocation of predicate returns nil. If the end of a sequence is reached, every returns a non-nil value. Thus, considered as a predicate, it is true if every invocation of predicate is true.
LISP: EXIT
C: Bye
min args: 0
max args: 0
[F][SSCL]
SYNOPSIS:
exit
DESCRIPTION:
The exit function unconditionally exits to the operating system, deleting the swap file.
SEE ALSO:
bye, quit
LISP: EXP
C: Lexp
min args: 1
max args: 1
[F][CLTL 12]
SYNOPSIS:
exp number
DESCRIPTION:
Returns e raised to the power number, where e is the base of the natural logarithms.
LISP: EXPORT
C: Export
min args: 1
max args: 2
[F][CLTL]
SYNOPSIS:
export symbols &optional package
DESCRIPTION:
The symbols argument should be a list of symbols, or possibly a single symbol. These symbols become accessible as external symbols in package. Export returns t.
LISP: EXPT
C: Lexpt
min args: 2
max args: 2
[F][CLTL 12]
SYNOPSIS:
expt base-number power-number
DESCRIPTION:
Returns base-number raised to the power power-number. If the base-number is of type rational and the power-number is an integer, the calculation will be exact and the result will be of type rational; otherwise a floating-point approximation may result.
When power-number is 0 (a zero of type integer), then the result is always the value one in the type of base-number, even if the base-number is zero (of any type). That is:
(expt x 0) == (coerce 1 (type-of x))
If the power-number is a zero of any other data type, then the result is also the value one, in the type of the arguments after the application of the contagion rules, with one exception: It is an error if base-number is zero when the power-number is a zero not of type integer.
NOTES:
Currently bignum bases do not work with floating point exponents; all other varieties work however.