Star Sapphire Common LISP Home

Download Star Saphire
Index

LISP: MACHINE-TYPE

min args: 0

max args: 0

[F][CLTL 25]

SYNOPSIS:

machine-type

DESCRIPTION:

A string is returned that identifies the generic name of the computer hardware on which Common LISP is running.

NOTES:

This is defined in init0.lsp.

 

LISP: MACHINE-INSTANCE

min args: 0

max args: 0

[F][CLTL 25]

SYNOPSIS:

machine-instance

DESCRIPTION:

A string is returned that identifies the particular instance of the computer hardware on which Common LISP is running; this might be a local nickname, for example, and/or a serial number.

NOTES:

This is defined in init0.lsp.

 

LISP: MACHINE-VERSION

min args: 0

max args: 0

[F][CLTL 25]

SYNOPSIS:

machine-version

DESCRIPTION:

A string is returned that identifies the version of the computer hardware on which Common LISP is running.

NOTES:

This is defined in init0.lsp.

 

LISP: MACRO-FUNCTION

C: LSymMac

min args: 1

max args: 1

[F][CLTL 8]

SYNOPSIS:

macro-function symbol

DESCRIPTION:

The function macro-function determines whether a given symbol is the name of a macro. The defmacro construct provides a convenient way to define new macros.

The argument must be a symbol. If symbol has a global function definition that is a macro definition, then the expansion function (a function of two arguments, the macro-call form and an environment) is returned. If the symbol has no global function definition, or has a definition as an ordinary function or as a special form but not as a macro, then nil is returned. The function macroexpand is the best way to invoke the expansion function.

It is possible for both macro-function and special-form-p to be true of a symbol. This is possible because an implementation is permitted to implement any macro also as a special form for speed. On the other hand, the macro definition must be available for use by programs that understand only the standard special forms.

macro-function cannot be used to determine whether a symbol names a locally defined macro established by macrolet; macro-function can examine only global definitions.

setf may be used with macro-function to install a macro as a symbols' global function definition:

(setf (macro-function symbol) fn)

The value installed must be a function that accepts two arguments, an entire macro call and an environment, and computes the expansion for that call. Performing this operation causes the symbol to have only that macro definition as its global function definition; any previous definition, whether as a macro or as a function, is lost. It is an error to attempt to redefine the name of a special form.

NOTES:

Currently, setf of macro-function will not work unless the object supplied to macro-function was produced by a call to macro-function.

 

LISP: MACROEXPAND

C: Lmacroexpand

min args: 1

max args: 2

[F][CLTL 8]

SYNOPSIS:

macroexpand form &optional env

DESCRIPTION:

Macroexpand allows the expansion of a macro call.

If form is a macro call, then macroexpand recursively expands the form until it is no longer a macro call. A form is considered a macro call only if it is a cons whose car is a symbol that names a macro.

The optional &environment argument has no effect in Star Sapphire, since Star Sapphire does not permit local macros.

SEE ALSO:

macroexpand-1

 

LISP: MACROEXPAND-1

C: L1macroexpand

min args: 1

max args: 2

[F][CLTL 8]

SYNOPSIS:

macroexpand-1 form &optional env

DESCRIPTION:

Macroexpand-1 allows the expansion of a macro call on one level.

If form is a macro call, then macroexpand expands the form once. A form is considered a macro call only if it is a cons whose car is a symbol that names a macro.

The optional &environment argument has no effect in Star Sapphire, since Star Sapphire does not permit local macros.

SEE ALSO:

macroexpand

 

LISP: MAKE-ARRAY

C: mkarray

min args: 1

max args: -1

[F][CLTL 17]

SYNOPSIS:

make-array dimensions &key :element-type :initial-element

:initial-contents :fill-pointer

DESCRIPTION:

This is the primitive function for making arrays. The dimensions argument should be a list of non-negative integers that are to be the dimensions of the array; the length of the list will be the dimensionality of the array. Each dimension must be smaller than array-dimension-limit, and the product of all the dimensions must be smaller than array-total-size-limit. Note that if dimensions is nil then a zero-dimensional array is created. For convenience when making a one-dimensional array, the single dimension may be provided as an integer rather than a list of one integer.

Do not be daunted by the many options of the function make-array! All that is required to construct an array is a list of the dimensions; most of the options are for relatively esoteric applications.

The keyword arguments for make-array are as follows:

:element-type

This argument should be the name of the type of the elements of the array; an array is constructed of the most specialized type that can nevertheless accommodate elements of the given type. The type t specifies a general array, one whose elements may be any LISP object; this is the default type.

:initial-element

This argument may be used to initialize each element of the array. The value must be of the type specified by the :element-type argument. If the :initial-element option is omitted, the initial values of the array elements are undefined (unless the :initial-contents or :displaced-to option is used). This option may not be used with the :initial-contents or :displaced-to options.

:initial-contents

This argument may be used to initialize the contents of the array. The value is a nested structure of sequences. If the array is zero-dimensional, the the value specifies the single element. Otherwise, the value must be a sequence whose length is equal to the first dimension; each element must be a nested structure for an array whose dimensions are the remaining dimensions, and so on. For example:

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

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

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

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

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

The numbers of levels in the structure must equal the rank of the array. Each leaf of the nested structure must be of the type specified by the :type option. If the :initial-contents option is omitted, the initial values of the array elements are undefined (unless the :initial-element option is used). The :initial-contents option may not be used with the :initial-element option.

:fill-pointer

This argument specifies that the array should have a fill pointer. If this option is specified and not nil, the array must be one-dimensional. The value is used to initialize the fill pointer for the array. If the value t is specified, the length of the array is used; otherwise the value must be an integer between 0 (inclusive) and the length of the array (inclusive). This argument defaults to nil.

If make-array is called with :fill-pointer, either unspecified or nil, then the resulting array is guaranteed to be a simple-array.

EXAMPLES:

;; Create a one-dimensional array of five elements.

(make-array 5)

;; Create a two-dimensional array, 3 by 4, with four-bit elements.

(make-array '(3 4) :element-type '(mod 16))

;; Create an array of single-floats.

(make-array 5 :element-type 'single-float))

NOTES:

Common LISP arrays are stored internally in row-major order.

SEE ALSO:

aref, aset, vector, array-rank-limit, array-dimension-limit, array-total-size-limit, svref, array-element-type, array-rank, array-dimension, array-dimensions, array-total-size, array-in-bounds-p, array-row-major-index, adjustable-array-p, fill-pointer, array-has-fill-pointer-p, vector-push, vector-pop.

 

LISP: MAKE-CHAR

C: Lmake_char

min args: 1

max args: 3

[F][CLTL 13]

SYNOPSIS:

make-char char &optional (bits 0) (font 0)

DESCRIPTION:

The make-char function constructs a character which has the same code attribute as char. Optionally bits and font attributes may be specified as well; these default to 0. If the bits and fonts values are out of the implementation specific range (as defined by char-bits-limit and char-font-limit) then the function returns nil. However if bits and fonts are 0, then the function cannot fail.

NOTES:

This function has been eliminated in ANSI Common LISP; it is likely that it will also be phased out in Star Sapphire.

 

LISP: MAKE-DISPATCH-MACRO-CHARACTER

C: MkDMC

min args: 1

max args: 3

[F][CLTL 22]

SYNOPSIS:

make-dispatch-macro-character char &optional non-terminating-p readtable

DESCRIPTION:

This causes the character char to be a dispatching macro character in readtable (which defaults to the current readtable.) If non-terminating-p is not nil (it defaults to nil), then it will be a non-terminating macro character: it may be embedded within extended tokens. Make-dispatch-macro-character returns t.

Initially every character in the dispatch table has a character-macro function that signals an error.

char must be a character.

SEE ALSO:

set-dispatch-macro-character to define entries in the dispatch table.

 

LISP: MAKE-HASH-TABLE

C: Lmakehashtable

min args: 2

max args: 2

[F][CLTL 16]

SYNOPSIS:

make-hash-table &key :test :size :rehash-size :rehash-threshold

DESCRIPTION:

The make-hash-table function makes and returns a new hash table.

The following keywords are used with this function. Keep in mind that the default values will work fine for most uses; the real impact on performance of adjusting these values is under most conditions minimal.

The :test keyword allows specification of a predicate to use to compare objects for equality. Star Sapphire allows this to be any predicate with one argument. Common LISP restricts this to eq, eql, or equal; ANSI adds equalp. In all implementations, the default is eql.

The :size argument sets the initial size of the hash table in entries.

The :rehash-size argument specifies how to grow the hash table when it reaches its rehashing threshold. If this is an integer, it is the number of entries to add; if this is a floating point number greater than one, this is the proportion between the new size and the old size. For instance, to double the hash table size with each rehash, specify :rehash-size 2.0; to add 2001 entries with each rehash, specify :rehash-size 2001.

The :rehash-threshold specifies how full the table can get before it is rehashed. This can be any real number between 0 and 1, inclusive. This indicates the maximum desired level of hash table occupancy.

The default hash table values are 256 entries in size, eql as the test, the rehash-threshold at 75% (0.75) and the rehash-size set at 150% (1.5). Thus these are the characteristics of a hash table returned by (make-hash-table) with no arguments.

 

LISP: MAKE-INSTANCE

C: Lmake_instance

min args: 1

max args: -1

[F][CLOS]

SYNOPSIS:

make-instance class &rest initargs

DESCRIPTION:

The make-instance function creates a new instance of the given class. The class argument can be a class object or a symbol that names a class. The remaining arguments form a list of alternating initialization argument names and values.

The new instance is returned.

SEE ALSO:

defclass

 

LISP: MAKE-LIST

C: Lmake_list

min args: 1

max args: 3

[F][CLTL 15]

SYNOPSIS:

make-list size &key :initial-element

DESCRIPTION:

This creates and returns a list containing size elements, each of which is initialized to the :initial-element argument (which defaults to nil). size should be a non-negative integer.

EXAMPLES:

(make-list 5) => (nil nil nil nil nil)

(make-list 3 :initial-element 'rah) => (rah rah rah)

 

LISP: MAKE-PACKAGE

C: LMkPkg

min args: 1

max args: -1

[F][CLTL]

SYNOPSIS:

make-package package-name &key :nicknames :use

DESCRIPTION:

This creates and returns a new package with the specified package-name. As described above, this argument may be either a string or a symbol. The :nicknames argument must be a list of strings to be used as alternative names for the package. The user may supply symbols in place of the strings, in which case the print names of the symbols are used. These names and nicknames must not conflict with any existing package names; if they do, a correctable error is signaled.

 

LISP: MAKE-RANDOM-STATE

C: Lmake_random_state

min args: 0

max args: 1

[F][CLTL 12]

SYNOPSIS:

make-random-state &optional state

DESCRIPTION:

This function returns a new object of type random-state, suitable for use as a random argument. If state is nil or omitted, random-state returns a copy of the current random-number state object (the seed). If state is a state object, a copy of that state object is returned. If state is t, then a new (very random) state object is returned, under DOS, this is initialized based on the contents of a core memory location whose address is calculated on the basis of the system clock.

NOTES:

Star Sapphire allows a fixnum argument to be used here to explicitly set the random number generator seed. This usage may not be portable to other implementations of Common LISP. In Star Sapphire a random-state is essentially the same as a fixnum.

 

LISP: MAKE-SEQUENCE

C: Lmake_sequence

min args: 2

max args: 4

[F][CLTL 14]

SYNOPSIS:

make-sequence type size &key :initial-element

DESCRIPTION:

This returns a sequence of type type and of length size, each of whose elements has been initialized to the :initial-element argument. If specified, the :initial-element argument must be an object that can be an element of a sequence of type type. For example:

(make-sequence '(vector double-float) 100

:initial-element 1d0)

If an :initial-element argument is not specified, then the sequence will be initialized in an implementation-dependent way. For instance, in Star Sapphire a list will be filled with nil; all other sequences are filled with zeros (in the case of strings, with ASCII NUL characters). It would not be prudent to write code which depends on a specific initial element in this case.

 

LISP: MAKE-STRING

C: Lmake_string

min args: 1

max args: 3

[F][CLTL 13]

SYNOPSIS:

make-string size &key :initial-element

DESCRIPTION:

This returns a string (in fact a simple-string) of length size, each of whose characters has been initialized to the :initial-element argument. If an :initial-element argument is not specified, then the string will be initialized to ASCII null characters.

 

LISP: MAKE-STRUCTURE

C: Lmkz

min args: 1

max args: -1

DESCRIPTION:

This function is an internal subroutine of the defstruct implementation and should not be called by user code.

 

LISP: MAKE-SYMBOL

C: Lmake_symbol

min args: 1

max args: 1

[F][CLTL 10]

SYNOPSIS:

make-symbol print-name

DESCRIPTION:

make-symbol creates a new symbol, whose print name is the string print-name. The value and function bindings of the newly created symbol will be unbound (vnil) and the property list will be empty (nil).

The symbol will not belong to any package; it will be uninterned and hence printed with a #: (that is, pound-sign dot) prefix. The result must be specifically interned using the intern function in order to belong to a package.

The string installed in the symbol's print-name slot is a copy of the string print-name.

The form

(symbol-name (make-symbol some-string))

will not be eq to some-string.

One should not alter a string once it has been given as an argument to make-symbol.

 

LISP: MAKUNBOUND

C: LSymMUB

min args: 1

max args: 1

[F][SSCL 7]

SYNOPSIS:

makunbound symbol

DESCRIPTION:

makunbound causes the dynamic (special) variable named by symbol to become unbound (have no value). For example:

(setq a 1)

a => 1

(makunbound 'a)

a => causes an error

The function returns the symbol argument as its value.

 

LISP: MAP

C: Lmap

min args: 3

max args: -1

[F][CLTL 14]

SYNOPSIS:

map result-type function sequence &rest more-sequences

DESCRIPTION:

The function must take as many arguments as there are sequences provided; at least one sequence must be provided. The result of map is a sequence such that element j is the result of applying function to element j of each of the sequences. The result sequence is as long as the shortest of the input sequences.

If the function 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.

The type of the result sequence is specified by the argument result-type (which must be a subtype of the type sequence), as for the function coerce.

In addition, one may specify nil for the result type, meaning that no result sequence is to be produced; in this case the function is invoked only for effect, and map returns nil. This gives an effect similar to that of mapc.

EXAMPLES:

(map 'list #'- '(1 2 3 4)) => (-1 -2 -3 -4)

(map 'string

#'(lambda (x) (if (oddp x) #\1 #\0))

'(1 2 3 4))

=> "1010"

LISP: MAPC

C: Lmapc

min args: 2

max args: -1

[F][CLTL 7]

SYNOPSIS:

mapc function list &rest more-lists

DESCRIPTION:

Mapping is a type of iteration in which a function is successively applied to pieces of one or more sequences. The result of the iteration is a sequence containing the respective results of the function applications.

The functional argument to a mapping function must be acceptable to apply; it cannot be a macro or the name of a special form. Of course, there is nothing wrong with using a function that has &optional and &rest parameters as the functional argument.

The function map may be used to map over any kind of sequence. The mapcar, maplist, mapc, mapl, mapcan, and mapcon functions operate only on lists.

mapcar operates on successive elements of the lists. First the function is applied to the car of each list, then to the cadr of each list, and so on. (Ideally all the lists are the same length; if not, 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 the successive calls to the function. For example:

(mapcar #'abs '(3 -4 2 -5 -6)) => (3 4 2 5 6)

(mapcar #'cons '(a b c) '(1 2 3)) => ((a . 1) (b . 2) (c . 3)

maplist is like mapcar except that the function is applied to the list and successive cdrs of that list rather than to successive elements of the list.

EXAMPLES:

(maplist #'(lambda (x) (cons 'foo x))

'(a b c d))

=> ((foo a b c d) (foo b c d) (foo c d) (foo d))

(maplist #'(lambda (x) (if (member (car x) (cdr x)) 0 1)))

'(a b a c d b c))

=> (0 0 1 0 1 1 1)

; An entry is 1 if the corresponding element of the input

; list was the last instance of that element in the input list.

mapl and mapc are like maplist and mapcar respectively, except that they do not accumulate the results of calling the function. These functions are used when the function is being called merely for its side effects, rather than its returned values. The value returned by mapl or mapc is the second argument, that is, the first sequence argument.

mapcan and mapcon are like mapcar and maplist respectively, except that they combine the results of the function using nconc instead of list. That is,

(mapcon f xl ... xn)

== (apply #'nconc (maplist f xl ... xn))

and similarly for the relationship between mapcan and mapcar. Conceptually, these functions allow the mapped function to return a variable number of items to be put into the output list. This is particularly useful for effectively returning zero or one item:

(mapcan #'(lambda (x) (and (numberp x) (list x)))

'(a 1 b c 3 4 d 5))

=> (1 3 4 5)

In this case the function serves as a filter; this is a standard LISP idiom using mapcan. (The function remove-if-not might have been useful in this particular context, however.) Remember that nconc is a destructive operation, and therefore so are mapcar and mapcon; the lists returned by the function are altered in order to concatenate them.

Sometimes a do or a straightforward recursion is preferable to a mapping operation; however, the mapping functions should be used wherever they naturally apply because this increases the clarity of the code.

The functional argument to a mapping function must be acceptable to apply; it cannot be a macro or the name of a special form. Of course, there is nothing wrong with using a function that has &optional and &rest parameters as the functional argument.

SEE ALSO:

mapcar, maplist, mapc, mapl, mapcan, mapcon.

 

LISP: MAPCAN

C: Lmapcan

min args: 2

max args: -1

[F][CLTL 7]

SYNOPSIS:

mapcan function list &rest more-lists

DESCRIPTION:

See mapc.

 

LISP: MAPCAR

C: Lmapcar

min args: 2

max args: -1

[F][CLTL 7]

SYNOPSIS:

mapcar function list &rest more-lists

DESCRIPTION:

See mapc.

 

LISP: MAPCON

C: Lmapcon

min args: 2

max args: -1

[F][CLTL 7]

SYNOPSIS:

mapcon function list &rest more-lists

DESCRIPTION:

See mapc.

 

LISP: MAPL

C: Lmapl

min args: 2

max args: -1

[F][CLTL 7]

SYNOPSIS:

mapl function list &rest more-lists

DESCRIPTION:

See mapc.

 

LISP: MAPLIST

C: Lmaplist

min args: 2

max args: -1

[F][CLTL 7]

SYNOPSIS:

maplist function list &rest more-lists

DESCRIPTION:

See mapc.

 

LISP: MAX

C: Lmax

min args: 1

max args: -1

[F][CLTL 12]

SYNOPSIS:

max number &rest more-numbers

DESCRIPTION:

The arguments may be any non-complex numbers. max returns the argument that is greatest (closest to positive infinity).

If the arguments are a mixture of rationals and floating-point numbers, and the largest argument is a rational, then the implementation is free to produce either that rational or its floating-point approximation; if the largest argument is a floating-point number of a smaller format than the largest format of any floating-point argument, then the implementation is free to return the argument in its given format or expanded to the larger format. More concisely, the implementation has the choice of returning the largest argument as is or applying the rules of floating-point contagion, taking all the arguments into consideration for contagion purposes. Also, if one or more of the arguments are equal, then any one of them may be chosen as the value to return.

(max 6 12) => 12

(max -6 -12) => -6

(max 1 3 2 -7) => 3

(max -2 3 0 7) => 7

(max 3) => 3

(max 5.0 2) => 5.0

(max 3.0 7 1) => 7 or 7.0

(max 1.0s0 7.0d0) => 7.0d0

(max 3 1 1.0s0 1.0d0) => 3 or 3.0d0

 

LISP: MEMBER

C: Lmember

min args: 2

max args: -1

[F][CLTL 15]

SYNOPSIS:

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

DESCRIPTION:

The list is searched for an element that satisfies the test. If none is found, nil is returned; otherwise, the tail of list beginning with the first element that satisfied the test is returned. The list is searched on the top level only. These functions are suitable for use as predicates. For example:

(member 'snerd '(a b c d)) => nil

(member-if #'numberp '(a #\Space 5/3 foo)) => (5/3 foo)

(member 'a '(g (a y) c a d e a f)) => (a d e a f)

Note, in the last example, that the value returned by member is eq to the portion of the list beginning with a. Thus rplaca on the result member maybe used to alter the found list element, if a check is first made that member did not return nil.

SEE ALSO:

find, position.

 

LISP: MEMBER (typespec)

[Typespec][CLTL 4]

SYNOPSIS:

member [object...]

DESCRIPTION:

This is a type specifier which only occurs at the car of a type specifier list. The member type specifier list indicates the set of objects which contains precisely the set of objects named. More precisely, an object belongs to the type if and only if it is is eql to one of the objects mentioned in the list.

EXAMPLES:

(typep 4 '(member 2 3 4 #*10101 'weird-science)) => t

(typep nil '(member 3.14159 "name")) => nil

 

LISP: MEMBER-IF

C: Lif_member

min args: 2

max args: -1

[F][CLTL 15]

SYNOPSIS:

member-if predicate list &key :key

DESCRIPTION:

See member.

 

LISP: MEMBER-IF-NOT

C: Lifn_member

min args: 2

max args: -1

[F][CLTL 15]

SYNOPSIS:

member-if-not predicate list &key :key

DESCRIPTION:

See: member.

 

LISP: MERGE

C: Lmerge

min args: 4

max args: -1

[F][CLTL 14]

SYNOPSIS:

merge result-type sequence1 sequence2 predicate &key :key

DESCRIPTION:

The sequences sequence1 and sequence2 are destructively merged according to an order determined by the predicate. The result is a sequence of type result-type, which must be a subtype of sequence, as for the function coerce. The predicate should take two arguments and return non-nil if and only if the first argument is greater than or equal to the second (in the appropriate sense). If the first argument is greater than or equal to the second (in the appropriate sense), then the predicate should return nil.

The merge function determines the relationship between two elements by giving keys extracted from the elements to the predicate. The :key function defaults to the identity function, thereby making the element itself be the key.

The :key function should not have any side effects. A useful example of a :key function would be a component selector function for a defstruct structure, used to merge a sequence of structures.

If the :key and predicate functions always return, then the merging operation will always terminate. The result of merging two sequences x and y is a new sequence z, such that the length of z is the sum of the lengths of x and y, and z contains all the elements of x and y. If x1 and x2 are two elements of x, and x1 precedes x2 in x, then x1 precedes x2 in z, and similarly for elements of y. In short, z is an interleaving of x and y. Moreover, if x and y were correctly sorted according to the predicate, then z will also be correctly sorted as shown in this example.

(merge 'list '(1 3 4 6 7) '(2 5 8) #'<) => (1 2 3 4 5 6 7 8)

If x or y is not so sorted, then z will not be sorted, but will nevertheless be an interleaving of x and y.

The merging operation is guaranteed stable; if two or more elements are considered equal by the predicate, then the elements from sequence1 will be precede those from sequence2 in the result. (The predicate is assumed to consider two elements x and y to be equal if (funcall predicate x y) and (funcall predicate y x) are both false.)

EXAMPLES:

(merge 'string "BOY" "nosy" #'char-lessp) => "BnOosYy"

The result can not be "BnoOsYy", "BnOosyY", or "BnOosYy".

The function char-lessp ignores case, and so considers the characters Y and y to be equal, for example; the stability property then guarantees that the character from the first argument (Y) must precede the one from the second argument (y).

 

LISP: MIN

C: Lmin

min args: 1

max args: -1

[F][CLTL 12]

SYNOPSIS:

min number &rest more-numbers

DESCRIPTION:

The arguments may be any non-complex numbers. min returns the argument that is least (closest to negative infinity).

If the arguments are a mixture of rationals and floating-point numbers, and the smallest argument is a rational, then the implementation is free to produce either that rational or its floating-point approximation; if the smallest argument is a floating-point number of a smaller format than the smallest format of any floating-point argument, then the implementation is free to return the argument in its given format or expanded to the smallest format . More concisely, the implementation has the choice of returning the smallest argument as is or applying the rules of floating-point contagion, taking all the arguments into consideration for contagion purposes. Also, if one or more of the arguments are equal, then any one of them may be chosen as the value to return.

EXAMPLES:

(min 6 12) =>6

(min -6 -12) => -12

(min 1 3 2 -7) => -7

(min -2 3 0 7) => -2

(min 3) => 3

(min 5.0 2) => 2 or 2.0

(min 3.0 7 1) => 1 or 1.0

(min 1.0s0 7.0d0) => 1.0s0 or 1.0d0

(min 3 1 1.0s0 1.0d0) => 1 or 1.0s0 or 1.0d0

 

LISP: MINUSP

C: Lminusp

min args: 1

max args: 1

[F][CLTL 12]

SYNOPSIS:

minusp number

DESCRIPTION:

This predicate is true if number is strictly less than zero, and is false otherwise. Since there are not distinct representations for positive and negative floating-point zeros, (minusp -0.0) is always false. It is an error if the argument number is not a non-complex number.

 

LISP: MOD

C: Lmodulus

min args: 2

max args: 2

[F][CLTL 12]

SYNOPSIS:

mod number divisor

DESCRIPTION:

mod performs the operation floor on its two arguments and returns the second result of floor as its only result.

mod is therefore the usual modulus functions when applied to two integer arguments. In general, however, the arguments may be integers or floating-point numbers.

EXAMPLES:

(mod 13 4) => 1

(mod -13 4) => 3

(mod 13 -4) => -3

(mod -13 -4) => -1

(mod 13.4 1) => 0.4

(mod -13.4 1) => 0.6

SEE ALSO:

mod (typespec)

 

LISP: MOD (typespec)

[Typespec][CLTL 4]

SYNOPSIS:

mod natural-integer

DESCRIPTION:

This is a type specifier which only participates in type specifier lists. (mod n) indicates the set of non-negative integers greater or equal to 0 and less than n.

In this case the argument must be specified and must be a non-negative integer.

EXAMPLES:

(typep 4 '(mod 4)) => nil

(typep -4 '(mod 55)) => nil

(typep 4 '(mod 5)) => t

 

LISP: MTRACE

C: LMtrace

min args: 0

max args: 0

[F][SSCL]

SYNOPSIS:

mtrace

DESCRIPTION:

The trace output does not normally yield much useful information about macroexpansion: This is due to the volume and redundancy of this information. If needed, the mtrace function will toggle output concerning macroexpansion. The default status of macro trace is off at startup. Successive calls to mtrace will turn on or off the macro trace.

Returns new macro trace status.

NOTES:

Guaranteed to produce too much information; use in conjunction with dribble is definitely advised. It also helps to set a good combination of the *print-pretty*, *print-length* and *print-depth* variables. Therefore using this should be a last resort.

On the list of future enhancements is making this selective, like trace.

 

LISP: MULTIPLE-VALUES-LIMIT

[C][CLTL 7]

SYNOPSIS:

multiple-values-limit

DESCRIPTION:

The value of multiple-values-limit is a positive integer; that is, the upper exclusive bound on the number of values that may be returned from a function. This number is one less than the largest positive fixnum. See lambda-parameters-limit and call-arguments-limit.

 

LISP: MULTIPLE-VALUE-BIND

C: SFCMVBind, EMVBind

[M][CLTL 7]

SYNOPSIS:

multiple-value-bind ({var}*) values-form {declaration}* {form}*

DESCRIPTION:

The values-form is evaluated and each of the variables var is bound to the respective value returned by the form. If there are more variables than values returned, extra values of nil are given to remaining variables. If there are more values than variables, the excess values are simply discarded. The variables are bound to the values over the execution of the forms, which make up an implicit progn.

BUGS:

Specials do not work in conjunction with this form.

 

LISP: MULTIPLE-VALUE-CALL

C: SFCMVCall, EMVCall

[S][SSCL 7]

SYNOPSIS:

multiple-value-call function {form}*

DESCRIPTION:

The multiple-value-call special form evaluates function to get a function and then evaluates all of the forms. All values of all of the forms are given as arguments to the function. The result of multiple-value-call is whatever is returned by the function.

EXAMPLES:

(multiple-value-call #'+ (floor 5 3)(floor 19 4)) => 10

(multiple-value-call #'list (floor 4.5) (floor 5.5))

=> '(4 0.5 5 0.5)

(multiple-value-call #'list (floor 4.5) 'foo) => '(4 0.5 foo)

 

LISP: MULTIPLE-VALUE-LIST

C: EMVLs

[M][CLTL 7]

SYNOPSIS:

multiple-value-list form

DESCRIPTION:

multiple-value-list evaluates form and returns a list of the multiple values it returned. For example:

(multiple-value-list (floor -3 4)) => (-1 1)

multiple-value-list and values-list are therefore inverses of each other.

 

LISP: MULTIPLE-VALUE-PROG1

C: SFCMVProg1, EMVProg1

[S][CLTL 7]

SYNOPSIS:

multiple-value-prog1 form {form}*

DESCRIPTION:

The multiple-value-prog1 special form evaluates the first form and saves all of the values produced by that form. It then evaluates all the other forms from left to right, discarding their values. The values produced by the first form are all returned. This must be used instead of prog1, which only returns a single value, when the first form may return multiple return values.

 

LISP: MULTIPLE-VALUE-SETQ

C: SFCMVSetq, EMVSetq

[M][CLTL 7]

SYNOPSIS:

multiple-value-setq variables form

DESCRIPTION:

The variables must be alist of variables. The form is evaluated and the variables are set (not bound) to the values returned by that form. If there are more variables than values returned, extra values of nil are assigned to the remaining variables. If there are more values than variables, the excess values are simply discarded. The multiple-value-setq macro always returns a single value, which is the first value returned by form, or nil if form returns no values.