User Tools


Special Operator THE

Syntax

  • the value-type formresult*

Arguments and Values

Description

the specifies that the values returned by form are of the types specified by value-type. The consequences are undefined if any result is not of the declared type.

It is permissible for form to yield a different number of values than are specified by value-type, provided that the values for which types are declared are indeed of those types. Missing values are treated as nil for the purposes of checking their types.

Regardless of number of values declared by value-type, the number of values returned by the is the same as the number of values returned by form.

Examples

(the symbol (car (list (gensym))))

#:G9876

(the fixnum (math-add|+ 5 7))

12

(the (values) (truncate 3.2 2))

1 1.2

(the integer (truncate 3.2 2))

1 1.2

(the (values integer) (truncate 3.2 2))

1, 1.2

(the (values integer float) (truncate 3.2 2))

1, 1.2

(the (values integer float symbol) (truncate 3.2 2))

1, 1.2

(the (values integer float symbol t null list) (truncate 3.2 2))

1, 1.2

(let ((i 100)) (declare (fixnum i)) (the fixnum (1+ i)))

101

(let* ((x (list 'a 'b 'c)) (y 5)) (setf (the fixnum (car x)) y) x)

(5 B C)

Affected By

None.

Exceptional Situations

The consequences are undefined if the values yielded by the form are not of the type specified by value-type.

See Also

Notes

The values type specifier can be used to indicate the types of multiple values:

(the (values integer integer) (floor x y)) (the (values string t) (gethash the-key the-string-table))

setf can be used with the type declarations. In this case the declaration is transferred to the form that specifies the new value. The resulting setf form is then analyzed.

\issue{THE-VALUES:RETURN-NUMBER-RECEIVED} \issue{THE-VALUES:RETURN-NUMBER-RECEIVED} \issue{THE-AMBIGUITY:FOR-DECLARATION} \issue{JUN90-TRIVIAL-ISSUES:27} \issue{THE-VALUES:RETURN-NUMBER-RECEIVED}