Rahul Kumar Saurabh

A Recursive LISP function which takes one argument as a list and return list except last element of the list.

           Programs in lisp with output



SOFTWARE USED:  LispWorks 6.1
THEORY:-
Assuming this is about Common Lisp, there is a function  which return list except last element of the list containing the except last item of a list.  If you use this function which applies a given function to each element of a list and returns the concatenated results.

SOURCE CODE ( IF INCLUDED )
(defun except_last_element(any_xyz_list)
(reverse(rest(reverse any_xyz_list))))

EXCEPT_LAST_ELEMENT

(except_last_element' (r a h u l k))

(R A H U L)


 RESULT:-



CONCLUSION:-
We learned about writing the function to which takes one argument as a list and return list except last element of the list.