LISP: NAME-CHAR
C: Lname_char
min args: 1
max args: 1
[F][CLTL 13]
SYNOPSIS:
name-char name
DESCRIPTION:
The name must be a string or symbol; if the name is the same as the name of a character object, that object is returned, otherwise, nil.
LISP: NAME-EDITOR
C: NameEditor
min args: 1
max args: 1
[F][SSCL]
SYNOPSIS:
name-editor editor-name
DESCRIPTION:
You can set the name of the editor using the Star Sapphire specific name-editor function. The intialization file lisp.cnf is shipped with a call to name your editor "emacs". This form is the first LISP form in the file.
The editor-name can be nil, in which case the built-in emacs editor is used; or a symbol or string which is the command by which another editor would be invoked from the operating system command line.
To use your editor instead of the built-in emacs, change the line in lisp.cnf:
(name-editor nil)
to the name of your editor. To use vi, for instance, you could change this to
(name-editor 'vi)
You can issue this command from the LISP prompt at any time, and use another editor.
NOTES:
This function is not supported yet in the Windows version, but will be at release. This documentation is retained as a placeholder.
If you use your own editor there must be enough memory to load it (about 100Kb). The built-in emacs does not use any additional memory for code because it is in the overlaid portion of LISP; thus it can use all free memory to load files.
LISP: NBUTLAST
C: Lnbutlast
min args: 1
max args: 2
[F][CLTL 15]
SYNOPSIS:
nbutlast list &optional n
DESCRIPTION:
This is the destructive version of butlast; it changes the cdr of the cons n + l from the end of the list to nil. n defaults to l. If the list has fewer than n elements, then nbutlast returns (), and the argument is not modified. (Therefore one normally writes (setq as (nbutlast a)) rather than simply (nbutlast a).)
EXAMPLES:
(setq foo '(a b c d))
(nbutlast foo) => (aa b c)
foo => (a b c)
(nbutlast '(a)) => ()
(nbutlast 'nil) => ()
LISP: NCONC
C: Lnconc
min args: 0
max args: -1
[F][CLTL 15]
SYNOPSIS:
nconc &rest lists
DESCRIPTION:
nconc
takes lists as arguments. It returns a list that is the arguments concatenated together. The arguments are changed, rather than copied. (Compare this with append, which copies arguments rather than destroying them.)EXAMPLES:
(setq x '(a b c))
(setq y '(d e f))
(nconc x y) => (a b c d e f)
x => (a b c d e f)
Note, in the example, that the value of x is now different, since its last cons has been rplacd'd to the value of y. If one were then to evaluate (nconc x y) again, it would yield a piece of "circular" list structure, whose printed representation would be (a b c d e f d e f d e f ...), repeating forever.
LISP: NIL
C: nilsym
[C][CLTL 6]
SYNOPSIS:
nil
DESCRIPTION:
The name nil is a predefined constant in Common LISP.
nil
is a symbol like any other symbol. It appears to be treated as a variable when evaluated, however, it is not permitted to modify its value, as if it were defined by defconstant.The value of nil is always nil. This object represents both the logical false value as well as the empty list. In the latter usage, nil can also be written ().
LISP: NIL (typespec)
[Typespec][CLTL 4]
SYNOPSIS:
nil
DESCRIPTION:
This is the type specifier symbol for the empty set of objects. No object will be of this type. See the type specifier t.
EXAMPLES:
(typep '() nil) => nil
(typep #*101010) => nil
; and so on...
LISP: NINTERSECTION
C: Lnintersection
min args: 2
max args: -1
[F][CLTL 15]
SYNOPSIS:
nintersection list1 list2 &key :test :test-not :key
DESCRIPTION:
nintersection
is the destructive version of intersection. It performs the same operation, but may destroy list1 using its cells to construct the result. (The argument list2 is not destroyed.)nintersection
takes two lists and returns a new list containing everything that is an element of both argument lists. If either list has duplicate entries, the redundant entries may or may not appear in the result. For example:(intersection '(a b c) '(f a d)) => (a)
There is no guarantee that the order of elements in the result will reflect the ordering of the arguments in any particular way. The implementation is therefore free to use any of a variety of strategies. The result list may share cells with, or be eq to, either of the arguments if appropriate.
In general, the test may be any predicate, and the intersection operation may be described as follows. For all possible ordered pairs consisting of one element from list1 and one element from list2, the test is used to determine whether they "match." For every matching pair, exactly one of the two elements of the pair will be put in the result. No element from either list appears in the result that does not match an element from the other list. All this is very general, but probably not particularly useful unless the test is an equivalence relation.
LISP: NINTH
C: Lninth
min args: 1
max args: 1
[F][CLTL 15]
SYNOPSIS:
ninth list
DESCRIPTION:
See first.
LISP: NOT
C: L_Not
min args: 1
max args: 1
[F][CLTL 6]
SYNOPSIS:
not x
DESCRIPTION:
not
returns t if its argument is nil, and otherwise returns nil. It therefore is typically used to invert boolean values.null
is identical to not; the use of one or the other is purely a matter of style. The two functions are used in different contexts; null is conventionally used to test for nil when it is used as the empty list; not is used as a predicate to test for nil when it is treated as the logical value false.
LISP: NOT (typespec)
[Typespec][CLTL 4]
SYNOPSIS:
not typespec
DESCRIPTION:
This is a type specifier which only participates in type specifier lists. A type specifier list with not at its head indicates the set of all objects which are not of the particular type.
The typespec is obligatory and cannot be unspecified.
EXAMPLES:
(typep 3 '(not symbol)) => t
(typep 3 '(not integer)) => nil
LISP: NOTANY
C: Lnotany
min args: 2
max args: -1
[F][CLTL 14]
SYNOPSIS:
notany predicate sequence &rest more-sequences
DESCRIPTION:
This function is a predicate. The function must take 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.
notany
returns nil as soon as any invocation of predicate returns a non-nil value. If the end of a sequence is reached, notany returns a non-nil value. Thus, considered as a predicate, it is true if no invocation of predicate is true.
LISP: NOTEVERY
C: Lnotevery
min args: 2
max args: -1
[F][CLTL 14]
SYNOPSIS:
notevery predicate sequence &rest more-sequences
DESCRIPTION:
This function is a predicate. The function must take 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.
NOTES:
notevery
returns a non-nil value as soon as any invocation of predicate returns nil. If the end of a sequence is reached, notevery invocation of predicate is true.
LISP: NRECONC
C: Lnreconc
min args: 2
max args: 2
[F][CLTL 15]
SYNOPSIS:
nreconc x y
DESCRIPTION:
(nreconc x y) is exactly the same as (nconc (nreverse x) y) except that it is potentially more efficient. Both x and y should be lists. The argument x is destroyed. Compare this with revappend.
LISP: NREVERSE
C: Lnreverse
min args: 1
max args: 1
[F][CLTL 14]
SYNOPSIS:
nreverse sequence
DESCRIPTION:
The result is a sequence containing the same elements as sequence but in reverse order. The argument may be destroyed and re-used to produce the result. The result may or may not be eq to the argument, so it is usually wise to say something like (setq x (nreverse x)), because simply (nreverse x) is not guaranteed to leave a reversed value in x.
SEE ALSO:
reverse
LISP: NSET-DIFFERENCE
C: Lnset_difference
min args: 2
max args: -1
[F][CLTL 15]
SYNOPSIS:
nset-difference list1 list2 &key :test :test-not :key
DESCRIPTION:
nset-difference
returns a list of elements of list1 that do not appear in list2. nset-difference is the destructive version of set-difference. This operation may destroy list1.There is no guarantee that the order of elements in the result will reflect the ordering of the arguments in any particular way. The implementation is therefore free to use any of a variety of strategies. The result list may share cells with, or be eq to, either of the arguments if appropriate.
In general, the test may be any predicate, and the set difference operation may be described as follows. For all possible ordered pairs consisting of one element from list1 and one element from list2, the test is used to determine whether they "match." An element of list1 appears in the result if and only if it does not match any element of list2. This is very general and permits interesting applications.
LISP: NSET-EXCLUSIVE-OR
C: Lset_exclusive_or
min args: 2
max args: -1
[F][CLTL 15]
SYNOPSIS:
nset-exclusive-or list1 list2 &key :test :test-not :key
DESCRIPTION:
nset-exclusive-or
returns a list of elements that appear in exactly one of list1 and list2. nset-exclusive-or is the destructive version of set-exclusive-or. Both lists may be destroyed in producing the result.There is no guarantee that the order of elements in the result will reflect the ordering of the arguments in any particular way. The implementation is therefore free to use any of a variety of strategies. The result list may share cells with, or be eq to, either of the arguments if appropriate.
In general, the test may be any predicate, and the set-exclusive-or operation may be described as follows. For all possible ordered pairs consisting of one element from list1 and one element from list2, the test is used to determine whether they "match." The result contains precisely those elements of list1 and list2 that appear in no matching pair.
LISP: NSTRING-CAPITALIZE
C: Lncastring
min args: 1
max args: -1
[F][CLTL 18]
SYNOPSIS:
nstring-capitalize string &key :start :end
DESCRIPTION:
This function is just like string-capitalize but destructively modifies the argument string by altering case-modifiable characters as necessary.
The keyword arguments :start and :end delimit the portion of the string to be affected. The argument string is returned as the result.
LISP: NSTRING-DOWNCASE
C: Lndnstring
min args: 1
max args: -1
[F][CLTL 18]
SYNOPSIS:
nstring-downcase string &key :start :end
DESCRIPTION:
This function is just like string-downcase but destructively modifies the argument string by altering case-modifiable characters as necessary.
The keyword arguments :start and :end delimit the portion of the string to be affected. The argument string is returned as the result.
LISP: NSTRING-UPCASE
C: Lnupstring
min args: 1
max args: -1
[F][CLTL 18]
SYNOPSIS:
nstring-upcase string &key :start :end
DESCRIPTION:
This function is just like string-downcase but destructively modifies the argument string by altering case-modifiable characters as necessary.
The keyword arguments :start and :end delimit the portion of the string to be affected. The argument string is returned as the result.
LISP: NSUBLIS
C: Lnsublis
min args: 2
max args: -1
[F][CLTL 15]
SYNOPSIS:
nsublis alist tree &key :test :test-not :key
DESCRIPTION:
nsublis
is like sublis but destructively modifies the relevant parts of the tree.nsublis
makes substitutions for objects in a tree (a structure of conses). The first argument to nsublis is an association list. The second argument is the tree in which substitutions are to be made, as for nsubst. nsublis looks at all subtrees and leaves of the tree; if a subtree or leaf appears as a key in the association list (that is, the key and the subtree or leaf satisfy the test), it is replaced by the object it is associated with.In effect, nsublis can perform several nsubst operations simultaneously.
LISP: NSUBST
C: Lnsubst
min args: 3
max args: -1
[F][CLTL 15]
SYNOPSIS:
nsubst new old tree &key :test :test-not :key
DESCRIPTION:
nsubst
is a destructive version of subst. The list structure of tree is altered by destructively replacing with new each leaf or subtree of the tree such that old and the leaf or subtree satisfy the test.(nsubst new old tree)
makes a copy of tree, substituting new for every subtree or leaf of tree (whether the subtree or leaf is a car or a cdr of its parent) such that old and the subtree or leaf satisfy the test. It returns the modified copy of tree.
LISP: NSUBST-IF
C: Lif_nsubst
min args: 3
max args: -1
[F][CLTL 15]
SYNOPSIS:
nsubst-if new test tree &key :key
DESCRIPTION:
See nsubst.
LISP: NSUBST-IF-NOT
C: Lifn_nsubst
min args: 3
max args: -1
[F][CLTL 15]
SYNOPSIS:
nsubst-if-not new test tree &key :key
DESCRIPTION:
See nsubst.
LISP: NTH
C: Lnth
min args: 2
max args: 2
[F][CLTL 15]
SYNOPSIS:
nth n list
DESCRIPTION:
(nth n list) returns the nth element of list, where the car of the list is the "zeroth" element. The argument n must be a non-negative integer. If the length of the list is not greater than n, then the result is (), that is, nil. (This is consistent with the idea that the car and cdr of () are each ().) For example:
(nth 0 '(foo bar gack)) => foo
(nth 1 '(foo bar gack)) => bar
(nth 3 '(foo bar gack)) => ()
nth
may be used to specify a place to setf; when nth is used in this way, the argument n must be less than the length of the list.Note that the arguments to nth are reversed from the order used by most other sequence selector functions such as elt.
LISP: NTHCDR
C: Lnthcdr
min args: 2
max args: 2
[F][CLTL 15]
SYNOPSIS:
nthcdr n list
DESCRIPTION:
(nthcdr n list) performs the cdr operation n times on list, and returns the result. For example:
(nthcdr 0 '(a b c)) => (a b c)
(nthcdr 2 '(a b c)) => (c)
(nthcdr 4 '(a b c)) => ()
In other words, it returns the nth cdr of the list.
(car (nthcdr n x)) == (nth n x)
LISP: NULL
C: L_Not
min args: 1
max args: 1
[F][CLTL 6]
SYNOPSIS:
null object
DESCRIPTION:
The null predicate returns t if its argument is the empty list (), and otherwise returns nil.
This is the same operation performed by the function not; using one or the other is a matter of style. not is normally used to produce the inverse of a Boolean value, while null is used to test for an empty list. Using one or the other announces the programmers' intent in a given context.
LISP: NULL (typespec)
[Typespec][CLTL 4]
SYNOPSIS:
null
DESCRIPTION:
This is the type specifier symbol which indicates the type of nil, the empty list.
EXAMPLES:
(typep '() 'null) => t
(typep nil 'null) => t
(type 3.14159 'null) => nil
LISP: NUMBER
[Typespec][CLTL 4]
SYNOPSIS:
number
DESCRIPTION:
This is the type specifier symbol which indicates the set of all numbers.
EXAMPLES:
(typep 3 'number) => t
(typep 'foo 'number) => nil
LISP: NUMBERP
C: Lnumberp
min args: 1
max args: 1
[F][CLTL 6]
SYNOPSIS:
numberp object
DESCRIPTION:
numberp
is true if its argument is any kind of number, and otherwise is false.(numberp x) == (typep x 'number)
LISP: NUMERATOR
C: Lnumerator
min args: 1
max args: 1
[F][CLTL 12]
SYNOPSIS:
numerator rational
DESCRIPTION:
This function takes a rational number (an integer or ratio) and returns as an integer the numerator of the canonical reduced form of the rational. The numerator of an integer is that integer.
(gcd (numerator x) denominator x)) => 1
The numerator may be any integer. For example:
(numerator (/ 8 -6)) => -4
LISP: NUNION
C: Lnunion
min args: 2
max args: -1
[F][CLTL 15]
SYNOPSIS:
nunion list1 list2 &key :test :test-not :key
DESCRIPTION:
nunion
is the destructive version of union.nunion
takes two lists and returns a new list containing everything that is an element of either of the lists. If there is a duplication between two lists, only one of the duplicate instances will be in the result. If either of the arguments has duplicate entries within it, the redundant entries may or may not appear in the result.There is no guarantee that the order of elements in the result will reflect the ordering of the arguments in any particular way. The implementation is therefore free to use any of a variety of strategies. The result list may share cells with, or be eq to, either of the arguments if appropriate.
In general, the test may be any predicate, and the nunion operation may be described as follows. For all possible ordered pairs consisting of one element from list1 and one element from list2, the test is used to determine whether they "match." For every matching pair, at least one of the two elements of the pair will be in the result. Moreover, any element from either list that matches no element of the other will appear in the result. All this is very general, but probably not particularly useful unless the test is an equivalence relation.
The :test-not argument can be useful when the test function is the logical negation of an equivalence test. A good example of this is the function mismatch, which is logically inverted so that possibly useful information can be returned if the arguments do not match. This additional "useful information" is discarded in the following example; mismatch is used purely as a predicate.