Star Sapphire Common LISP Home

Download Star Saphire
Index

LISP: ABS

C: Labs

min args: 1

max args: 1

[F][CLTL 12]

SYNOPSIS:

abs number -> number

DESCRIPTION:

The abs function returns the absolute value of its argument. The argument must be a number.

The result will always be of the same type as the argument.

EXAMPLES:

(abs 3) -> 3

(abs -3) -> 3

 

LISP: ACONS

C: Lacons

min args: 3

max args: 3

[F][CLTL 15]

SYNOPSIS:

acons key datum a-list

DESCRIPTION:

acons constructs an association list. An association list is either the empty list or a list of lists. Each sublist consists of a pair of items. Each sublist defines an association between the two items; the first is considered the key and the second is considered a datum.to associate with the key.

acons adds the pair (key datum) to the association list a-list. Essentially:

(acons x y a) == (cons (cons x y) a)

EXAMPLE:

The following acons calls construct a small database of names and phone numbers:

(setq phone-list '())

(acons betty 555-4356 phone-list)

(acons jim 555-1092 phone-list)

(acons sue 555-3469 phone-list)

; now phone list contains:

((sue 555-3469)(jim 555-1092)(betty 555-4356))

SEE ALSO:

pairlis, assoc, assoc-if, assoc-if-not, rassoc, rassoc-if, rassoc-if-not

 

LISP: ACOS

C: Lacos

min args: 1

max args: 1

[F][CLTL 12]

SYNOPSIS:

acos number -> number

DESCRIPTION:

acos returns the arc cosine of number, which is considered to be an angle expressed in radians. The result is in radians.

SEE ALSO:

sin, cos, tan, acos, atan, asinh, acosh, atanh.

 

LISP: ADJOIN

C: Ladjoin

min args: 2

max args: -1

[F][CLTL 15]

SYNOPSIS:

adjoin item list &key :test :test-not :key

DESCRIPTION:

adjoin adds item to list, if and only if it is not already in the list, based on an equality predicate. This is one of the functions which allow set operations on lists.

The equality test defaults to eql. Essentially

(adjoin item list) == (if (member item list) list (cons item list))

The test may be specified as an arbitrary predicate using the :test, :test-not and :key keyword values. The item is added to the list only if there is no element of list that satisfies the test.

adjoin differs from the usual rules for the treatment of arguments named item and key. If a :key function is specified, it is applied to item as well as to each element of the list. The reason is as follows: If the item is not yet in the list, it soon will be, and so the test is more properly viewed as being between two elements rather than between a separate item and an element. Therefore:

(adjoin item list :key fn) ==

(if (member (fn item) list :key fn) list (cons item list))

SEE ALSO:

pushnew, member, member-if, member-if-not, tailp, union, nunion, intersection, nintersection, set-difference, nset-difference, set-exclusive-or, nset-exclusive-or, subsetp.

 

LISP: ADJUSTABLE-ARRAY-P

C: arrap

min args: 1

max args: 1

[F][CLTL 17]

SYNOPSIS:

adjustable-array-p array

DESCRIPTION:

If the array argument (which must be an array) is adjustable this predicate will return t, and otherwise nil.

NOTES:

Adjustable arrays are not supported in the current version of Star Sapphire Common LISP, so this function, included for compatibility, always returns nil.

 

LISP: ALPHA-CHAR-P

C: LAlpCharP

min args: 1

max args: 1

[F][CLTL 13]

SYNOPSIS:

alpha-char-p char -> boolean

DESCRIPTION:

alpha-char-p returns t if the char argument is an alphabetic character in the range #\A through #\Z or #\a through #\z. If it is not alphabetic the function returns nil.

The char argument must be a character object, otherwise an error is raised.

If a character is alphabetic, then it is also graphic (in this context this means that it has a printed glyph).

EXAMPLES:

(alpha-char-p #\3) -> nil

(alpha-char-p #\d) -> t

 

LISP: ALPHANUMERICP

C: LAlNCharP

min args: 1

max args: 1

[F][CLTL 13]

SYNOPSIS:

alphanumericp char

DESCRIPTION:

alphanumericp returns t if char is an alphabetic character in the range #\A through #\Z, #\a through #\z, or #\0 through #\9. If char is not alphanumeric it returns nil.

char must be a character object, otherwise an error is raised.

If a character is alphanumeric, then it is also graphic (in this context graphic means that it has a printed glyph).

(alphanumericp x) == (or (alpha-char-p x) (not (null (digit-char-p x))))

EXAMPLES:

(alphanumericp #\+) -> nil

(alphanumericp (aref "hello there" 3)) -> t

(alphanumericp #\R) -> t

 

LISP: AND

C: EAnd

min args: 0

max args: -1

[M][CLTL 6]

SYNOPSIS:

and {form}* -> boolean

DESCRIPTION:

The and macro evaluates each of its forms sequentially from left to right. If any form evaluates to nil, the value nil is returned without evaluating the remaining forms. If every form but the last evaluates to a non-nil value, and returns what the last form returned. Therefore, and can be used both for logical operations, where nil stands for false and non-nil values stand for true, and also as a conditional expression. For example:

(if (and

(typep x 'list)

(typep (car x) 'list)

(typep (caar x) 'list))

(caaar x))

The caaar function returns the car of the car of the car of a list; it will produce an error if this object cannot be obtained. By testing whether the car can be obtained of each successive car, the error is forestalled; nil will be returned if there is not a caaar of the list x.

The and macro acts like a sequence of && clauses in C; it effectively short-circuits the evaluation if the test is not met at any point in the sequence. In this respect it is unlike the Pascal or Ada and operator, which always evaluates both arguments.

Some experienced LISP programmers like to write the previous example like this:

(and

(typep x 'list)

(typep (car x) 'list)

(typep (caar x) 'list)

(caaar x))

which means the same thing. The difference is purely stylistic. Some programmers, on the other hand, never use expressions containing side effects within and, preferring to use if or when for that purpose One slight disadvantage of the above idiom is that if an else clause is needed, the form will have to be changed into an if.

As a base case,

(and) => T,

which is an identity for this operation. Also note that

(and x)=>x.

NOTES:

One can define and in terms of cond as follows:

(and a b c ... m) ==

(cond ((not a) nil)

((not b) nil)

((not c) nil)

...

(t m)))

If it is necessary to test whether a predicate is true of all elements of a list or vector then the function every may be useful.

SEE ALSO:

not, or, if, when, unless, cond

 

LISP: AND (typespec)

min args: 0

max args: -1

[Typespec][CLTL 4]

SYNOPSIS:

and {typespec}*

DESCRIPTION:

An and type specifier denotes the intersection of the specified typespecs. That is, an object is of the type '(and type1 type2 type3) if and only if it is of all three types type1, type2 and type3.

The and type specifier can occur at the car of a type specifier list.

More precisely, each typespec in turn is compared with the given object and nil is returned when the first non-matching typespec is encountered. Otherwise t is returned.

As a base case (and) matches all types whatsoever.

EXAMPLES:

(typep 3 '(and number integer fixnum)) => t

; specifies symbols which start with the letter F

(typep 'foo '(and symbol

(satisfies

(lambda (x)(eq (aref (symbol-name x) 0) #\F)))))

=> t

; difficult criteria to meet

(typep #*1010 (and number hash-table read-table)) => nil

 

LISP: APPEND

C: Lappend

min args: 0

max args: -1

[F][CLTL 15]

SYNOPSIS:

append &rest lists -> list

DESCRIPTION:

append builds a new list from the top level contents of its list arguments. The arguments are not destroyed or copied.

All of the lists, except for the last, must be lists (conses or the empty list).

The last argument may be of any type. The new list will consist of the top level contents of the list arguments. The last argument, irregardless of type, becomes the tail of the new list, and does not get copied. If it is a list, it will also effectively be concatenated to the list; if not, the result will be a dotted list with the last argment in the cdr.

(append x '()) was once frequently used to copy the list x, but copy-list is now considered more appropriate.

EXAMPLES:

(append '(1 2 3) nil '(4 5 6) '(7)) => (1 2 3 4 5 6 7)

(append '(1 2 3) #\x) => (1 2 3 . #\x)

SEE ALSO:

concatenate,nconc.

 

LISP: APPLY

C: LApply

min args: 2

max args: -1

[F][CLTL 7]

SYNOPSIS:

apply function arg &rest more-args -> form

DESCRIPTION:

apply runs a function on a list of arguments.

The first argument specifies the function to apply. Other arguments to apply are specified by successive arguments.

The function argument must be of type function or symbol.

A functional argument can be expressed using the function special form (or its shorthand #') on a lambda expression:

(setq f #'/)

(apply f 1 2) => 1/2

If the function argument is a symbol, the global functional value of that symbol is used. The symbol cannot be the name of a macro or special form:

(setq f '*)

(apply f 3 2) => 6

The second (N.B.: required) argument is an argument to give to the function as the function's 0th argument.

Third and successive apply arguments are likewise given as the (arg-1)th arguments to the function, where arg is the offset of the argument in apply's argument list.

The last argument may be a list, in which case the top level elements of that list are also appended to the argument list of the function to call. It is as if all the arguments to apply except the function were given to list* to create the argument list.

(apply #'min 3 5 '(2 7 3)) => 2

(apply 'cons '((+ 2 3) 4)) => ((+ 2 3) . 4) ... not (5 . 4)

Hence the way to give no arguments to the function is to specify the empty list as the second argument.

(apply #'+ '()) => 0

NOTES:

If the function takes keyword arguments, the keywords, as well as the corresponding values, must appear in the argument list:

(apply # ' (lambda (&key a b) list a b)) '(:b 3)) => (nil 3)

This can be used with the &allow-other-keys feature:

(defun foo (size &rest keys &key double &allow-other-keys)

(let ((v (apply #'make-array size :allow-other-keys t keys)))

(if double (concatenate (type-of v) v v) v)))

(foo 4 :initial-contents '(a b c d) :double t) => #(a b c d a b c d)

 

LISP: APROPOS

C: Lapropos

min args: 1

max args: 2

[F][CLTL 25]

SYNOPSIS:

apropos string-or-symbol &optional package ->|

DESCRIPTION:

The first argument to apropos is a string or symbol. apropos searches all package hash tables to find symbols with substrings matching the given string-or-symbol. If the second argument is specified and is not nil, then only package is searched.

The information is simply printed to the display; the function returns no values.

If any of the symbols found have a value or functional definition, that information is printed.

EXAMPLE:

The following example will print all names of all symbols (particularly the mouse functions) containing the string mouse to the display:

(apropos 'mouse)

SEE ALSO:

apropos-list, describe

 

LISP: APROPOS-LIST

C: LaproposLs

min args: 1

max args: 2

[F][CLTL 25]

SYNOPSIS:

apropos-list string-or-symbol &optional package -> list

DESCRIPTION:

The first argument to apropos-list is a string or symbol. Apropos-list searches all package hash tables to find symbols with substrings matching the given string-or-symbol. If the second package argument is specified and is not nil, then only package is searched. A list is constructed of the symbols found and is returned as the value of apropos-list.

SEE ALSO:

apropos, describe

 

LISP: AREF

C: Aref

Min Args: 1

Max Args: -1

[F][CLTL 17]

SYNOPSIS:

aref array &rest subscripts -> object

DESCRIPTION:

aref is the most general way to obtain access to an element of an array, be it a string, vector, bit-vector, or general array..

aref accesses and returns the element of the array argument specified by the subscripts. To replace an array element with a new value, you can use setf with aref (assuming you have loaded the defsetf boot code, defsetf.fsl). For instance:

(setf (aref "hello" 3) #\@) -> "hel@o"

Each subscript must be a non-negative, non-bignum integer less than the corresponding array dimension. The number of subscripts must equal the rank of the array.

aref completely ignores fill pointers, unlike most other array functions. aref can access any element in an array, whether active or not, without triggering an error. This is unlike the generic sequence function elt. It is illegal to access an array element beyond the fill pointer while using elt.

EXAMPLE:

(setq x (make-array '(4 2 3) :initial-contents

'(((a b c) (0 2 3))

((d e f) (3 1 2))

((g h i) (2 3 1))

((j k l) (0 0 0)))))

(setq flattened-x

(list

(aref x 0 0 0) (aref x 0 0 1) (aref x 0 0 2)

(aref x 0 1 0) (aref x 0 1 1) (aref x 0 1 2)

(aref x 1 0 0) (aref x 1 0 1) (aref x 1 0 2)

(aref x 1 1 0) (aref x 1 1 1) (aref x 1 1 2)

(aref x 2 0 0) (aref x 2 0 1) (aref x 2 0 2)

(aref x 2 1 0) (aref x 2 1 1) (aref x 2 1 2)

(aref x 3 0 0) (aref x 3 0 1) (aref x 3 0 2)

(aref x 3 1 0) (aref x 3 1 1) (aref x 3 1 2)))

(tree-equal

flattened-x

'(a b c 0 2 3 d e f 3 1 2 g h i 2 3 1 j k l 0 0 0)) => T

SEE ALSO:

Other array access functions exist, like bit, svref, and char; these can be used in specialized circumstances for clarity and efficiency.

NOTES:

Under some circumstances it is desirable to write code that will extract an element from an array a given a list z of the indices, in such a way that the code works regardless of the rank of the array. This is easy using apply:

(apply #'aref a z)

(The length of the list must equal the rank of the array.) This construction may be used with setf to alter the element so selected to some new value w:

(setf (apply #'aref a z) w)

 

LISP: ARRAY

min args: 0

max args: 2

[Typespec][CLTL 4]

SYNOPSIS:

array [element-type [dimspec]]

array

DESCRIPTION:

The array symbol can be used by itself or as the car of a type specifier list to indicate the array type. Arrays are rectangular arrangements of LISP objects.

When used in a type specifier list, array indicates the set of arrays with elements of element-type and dimensions matching dimspec. In this case either argument may be unspecified, either by omission or by being written *.

The element-type, if specified, must be a valid type specifier.

The dimspec, if specified, may either be a non-negative integer or a list of non-negative integers. A single integer indicates a one-dimensional array of the given length. A list of integers specifies the length of each dimension. A given dimension may be written as unspecified using *.

EXAMPLES:

(typep "hello" 'array) => t ; strings are considered a subtype of array

(typep #a2((2 2) (2 2) (3 3)) 'array) => t

(typep (make-array (2 2) :element-type integer)

'(array 'integer (* 2))) => T

(typep "hello world" '(array 'character)) => T

(typep #*10101 '(array bit *)) => T

 

LISP: ARRAY-DIMENSION

C: arrad

min args: 2

max args: 2

[F][CLTL 17]

SYNOPSIS:

array-dimension array axis-number -> integer

DESCRIPTION:

array-dimension returns the allocated length of dimension axis-number of the array argument, ignoring fill pointers in the case of vectors.

The array argument must be an array of any type, and axis-number must be a non-negative integer less than the total rank (number of dimensions) of array.

NOTES:

The generic sequence function length will return the size indicated by a vectors fill pointer.

SEE ALSO:

array-rank, array-dimension, array-total-size, array-in-bounds-p

 

LISP: ARRAY-DIMENSION-LIMIT

[C][CLTL 17]

SYNOPSIS:

array-dimension-limit

DESCRIPTION:

The value of array-dimension-limit is a positive integer that is the upper exclusive bound on each individual dimension of an array. The value of this constant in Star Sapphire is 4,294,967,296. This is defined in init0.lsp for inclusion in your code.

 

LISP: ARRAY-DIMENSIONS

C: arrads

min args: 1

max args: 1

[F][CLTL 17]

SYNOPSIS:

array-dimensions array- > list

DESCRIPTION:

The array-dimensions function returns a list consisting of the length of each of the dimensions of array.

EXAMPLE:

(array-dimensions (make-array '(2 3 5 7 9 13))) -> (2 3 5 7 9 13)

SEE ALSO:

array-rank, array-dimension, array-total-size.

 

LISP: ARRAY-ELEMENT-TYPE

C: arret

min args: 1

max args: 1

[F][CLTL 17]

SYNOPSIS:

array-element-type array -> type-specifier

DESCRIPTION:

The array-element-type function returns a type specifier for the objects that can be stored in array. This will be the value of the :element-type keyword if the array was created using make-array with :element-type (or t if :element-type was not used), and some sensible general type for other arrays, such as strings or bit-vectors (character and bit, respectively).

SEE ALSO:

make-array, array, string

 

LISP: ARRAY-HAS-FILL-POINTER-P

C: arrahf

min args: 1

max args: 1

[F][CLTL 17]

SYNOPSIS:

array-has-fill-pointer-p array-> boolean

DESCRIPTION:

array-has-fill-pointer-p returns t if the argument array has a fill pointer, otherwise nil. array-has-fill-pointer-p always returns nil if the array is not one-dimensional.

The array argument must be an array.

SEE ALSO:

make-array, vector, array, fill-pointer, vector-push, vector-pop

LISP: ARRAY-IN-BOUNDS-P

C: aibp

min args: 1

max args: -1

[F][CLTL 17]

SYNOPSIS:

array-in-bounds-p array &rest subscripts -> boolean

DESCRIPTION:

The array-in-bounds-p predicate checks whether its argument list makes a legal set of subscripts for the array argument. The return value is t if they are and nil otherwise. The first argument must be some type of array; the subscripts must be non-negative, non-bignum, integers. The number of subscripts supplied must equal the rank of the array. array-in-bounds-p ignores fill pointers in the case of vectors, like aref.

 

LISP: ARRAY-RANK

C: arrar

min args: 1

max args: 1

[F][CLTL 17]

SYNOPSIS:

array-rank array -> integer

DESCRIPTION:

array-rank returns the rank, or number of dimensions, of the argument array, which must be an object of some array type.

The return value will be a non-negative, non-bignum integer.

SEE ALSO:

array-rank-limit.

 

LISP: ARRAY-RANK-LIMIT

[C][CLTL 17]

SYNOPSIS:

array-rank-limit

DESCRIPTION:

This is a positive integer which is the upper exclusive bound on the rank of an array. In Star Sapphire this is 65536. This is defined in init0.lsp for optional inclusion in user code.

 

LISP: ARRAY-ROW-MAJOR-INDEX

C: armidx

min args: 1

max args: -1

[F][CLTL 17]

SYNOPSIS:

array-row-major-index array &rest subscripts

DESCRIPTION:

array-row-major-index calculates the row-major index, in the block of memory allocated for array, of the element identified by the subscripts. This will be a non-negative integer less than the total size of the array. The array argument must be of some array type. The number of subscript arguments must equal the rank of the array. Each subscript must be a non-negative, non-bignum integer less than the corresponding array dimension.

For a one-dimensional array, the result of array-row-major-index always equals the supplied subscript.

NOTES:

array-row-major-index ignores fill pointers, like aref.

 

LISP: ARRAY-TOTAL-SIZE

C: arrts

min args: 1

max args: 1

[F][CLTL 17]

SYNOPSIS:

array-total-size array -> integer

DESCRIPTION:

The array-total-size function returns the total number of elements in array. This will be the product of all the dimensions of the array.

The argument must be an object of some array type.

NOTES:

The total size of a zero-dimensional array is 1. array-total-size when given a one-dimensional array does not take into regard the fill pointer.

 

LISP: ARRAY-TOTAL-SIZE-LIMIT

[C][CLTL 17]

SYNOPSIS:

array-total-size-limit

DESCRIPTION:

The value of array-total-size-limit is a positive integer that is the upper exclusive bound on the total number of elements in an array. The value of this constant in Star Sapphire is 8388608.

 

LISP: ARRAYP

C: Larrayp

min args: 1

max args: 1

[F][CLTL 7]

SYNOPSIS:

arrayp object -> boolean

DESCRIPTION:

arrayp returns t if its argument is an array of any kind (such as a vector, a string, a bit vector or a general array), otherwise nil.

 

LISP: ASET

C: aset

min args: 2

max args: -1

[F][SSCL]

SYNOPSIS:

aset array &rest subscripts item -> object

DESCRIPTION:

This function is the Star Sapphire specific setf method for aref, allowing the setting of a given element of an array.

The array argument must be some type of array. The remaining arguments are the subscripts in the array which specify the item to set; these must be non-negative non-bignum integers and must be legal subscripts in the array. The item argument is the value to set. The return value from aset is item.

The slightly unconventional calling protocol is made neccesary by defsetf.

Although aset is non-standard, it can be assumed that other implementations of Common LISP will have some equivalent internal function; possibly with a similar name and calling sequence (due to parallel evolution, no doubt). However, code which is intended to be portable will not use this function directly, rather via setf of aref.

The following code converts aset into aref's setf method. Since this is one of the most popular setf methods, it is included in the defsetf.lsp startup code:

(defsetf aref aset)

Other setf methods can be found in init0.lsp.

 

LISP: ASH

C: Lash

min args: 2

max args: 2

[F][CLTL 12]

SYNOPSIS:

ash integer count

DESCRIPTION:

The ash function shifts integer arithmetically left by count bit positions if count is positive, or right by count bit positions if count' is negative. The sign of the result is always the same as the sign of integer.

Logically, this moves all of the bits in integer to the left, adding zero-bits at the bottom, or moves them to the right, discarding bits. (In this context the question of what gets shifted in on the left is irrelevant; integers, viewed as strings of bits, are "half-infinite," that is, conceptually extend infinitely far to the left.)

The following equivalence holds:

(logbitp j (ash n k)) == (and (>= j k) logbitp (- j k) n))

 

LISP: ASIN

C: Lasin

min args: 1

max args: 1

[F][CLTL 12]

SYNOPSIS:

asin number -> number

DESCRIPTION:

asin returns the arc sine of its argument, which must be a number. The number is considered to be an angle expressed in radians. The result is also in radians.

SEE ALSO:

acos, atan, sin, cos, tan, asinh, acosh, atanh

 

LISP: ASSOC

C: Lassoc

min args: 2

max args: -1

[F][CLTL 15]

SYNOPSIS:

assoc item a-list &key :test :test-not :key -> sub-a-list

DESCRIPTION:

assoc searches the association list a-list for the first pair in the a-list such that the car of the pair satisfies the test, or nil if there is no such pair in the a-list. Association lists are useful for constructing simple lookup tables (although this is not very efficient if the tables get to be big).

For instance:

(setq room-assignments

'((1 . bob)(2 . carol)(3 . ted)(4 . alice)))

(assoc 3 room-assignments) => (3 . ted)

(assoc 2 room-assignments) => (2 . carol)

The return value is the dotted list whose head is item. Thus rplacd can be used on the result of assoc (provided that it is not nil). This permits updating the entry for the item that was assoc's second argument.

So:

(rplacd (assoc room-assignments 2) 'mary)

puts Mary in room 2 instead of Carol.

Another method is to use cdr on the value returned by assoc. If nil considered to be the value which indicates 'not found in the table', the following code will be nil if room 13 does not exist:

(cdr (assoc room-assignments 13))

while returning the occupant of room 13 if there is such a room.

The reason is because the cdr of nil is always nil, this yields nil if no pair is found or if a pair is found whose cdr is nil.

NOTES:

assoc is similar to find, with one major difference:

(assoc item list :test fn)

and

(find item list :test fn :key #'car)

are equivalent in meaning unless nil appears in the association list list in place of a pair, and the item being searched for is nil. In this case find will examine the car of the nil in the association list, find that it is equal to the item, and return nil.

On the other hand, assoc will ignore the nil in the association list and continue to search for an actual pair whose car is nil.

SEE ALSO:

assoc-if, assoc-if-not, find, position. The hash table facility will be substantially more efficient for lookup tables if the table is intended to of arbitrary size: see make-hash-table.

 

LISP: ASSOC-IF

C: Lif_assoc

min args: 2

max args: -1

[F][CLTL 15]

SYNOPSIS:

assoc-if predicate a-list

DESCRIPTION:

assoc-if returns the first pair in the association list a-list such that the car of the pair satisifies the function predicate. assoc-if returns nil if no pair is found. The predicate must take exactly one argument.

SEE ALSO:

assoc, assoc-if-not.

 

LISP: ASSOC-IF-NOT

C: Lifn_assoc

min args: 2

max args: -1

[F][CLTL 15]

SYNOPSIS:

assoc-if-not predicate a-list

DESCRIPTION:

assoc-if returns the first pair in the association list a-list such that the car of the pair does not satisfy the function predicate. assoc-if-not returns nil if no pair is found. The predicate must take exactly one argument.

SEE ALSO:

assoc, assoc-if.

 

LISP: ATAN

C: Latan

min args: 1

max args: 1

[F][CLTL 12]

SYNOPSIS:

atan y &optional x -> number

DESCRIPTION:

The atan function returns the arc tangent of y, if one argument is given, or the arc tangeant of y/x if there are two arguments. Both x and y are considered to be in radians. The result is returned in radians.

The signs of y and x are used to derive quadrant information. x may be zero provided y is not zero. The value of atan is always between negative p (exclusive) and p (inclusive).

NOTES:

The current version does not support the second argument variation.

 

LISP: ATOM

min args: 1

max args: 1

[F][CLTL 6]

SYNOPSIS:

atom object

DESCRIPTION:

The atom predicate evaluates to t if object is not a cons (a non-empty list). Otherwise it returns nil.

Note that (atom '()) is t, because the empty list '() is nil, which is not a cons.

(atom x) == (typep x 'atom) == (not (typep x 'cons))

 

LISP: ATOM (typespec)

min args: 1

max args: 1

[Typespec][CLTL 4]

SYNOPSIS:

atom

DESCRIPTION:

This is the type specifier symbol which specifies the type consisting of all non-cons data objects.