You can use the EVERY function:
(every #'identity '(T T T T T)) -> T
and
(every #'identity '(T T T T NIL)) -> NIL
Probably the most efficient way is using LOOP:
(loop for element in '(T T T T nil) always element) -> NIL
The advantage is that no function calls over the list elements are needed.
#'
is a read macro that expands into FUNCTION during read the expression. So #'and
is (FUNCTION AND).
FUNCTION is described here: http://www.lispworks.com/documentation/HyperSpec/Body/s_fn.htm
FUNCTION takes a function name or a lambda expression and returns the corresponding function object.
AND is defined here: http://www.lispworks.com/documentation/HyperSpec/Body/m_and.htm
It says that AND is a macro, not a function. The consequence is that (FUNCTION AND) does not work, since FUNCTION needs a function and not a macro to return the corresponding function object. As sepp2k describes in his answer, you can create a function using LAMBDA and use the macro AND inside that function. Macros cannot be passed as values and later be called via FUNCALL or APPLY. This works only with functions.
This solution is written as
(reduce (lambda (x y) (and x y)) (get-some-list))
LAMBDA is a macro that expands (lambda (...) ...)
into (function (lambda (...) ...))
.
So above is really:
(reduce (function (lambda (x y) (and x y))) (get-some-list))
which can be written as
(reduce #'(lambda (x y) (and x y)) (get-some-list))
FUNCTION is needed because Common Lisp makes a difference between the namespace for values and functions. REDUCE needs to get the function passed as an argument by value. So we need to retrieve the function from the function namespace -- which is the purpose of FUNCTION. Whenever we want to pass a function object, we need to get it from the function namespace.
For example in the case of a local function:
(flet ((my-and (x y) (and x y)))
#'my-and)
LAMBDA as a convenience macro that expands into (FUNCTION (LAMBDA ...)) has been added during the design of Common Lisp.