Visitor No.

Sunday, 13 December 2015

Recursive LISP function which appends two lists together.

9 - Define a Recursive LISP function which appends two lists together.

      Implementation Code in LISP - 

       (defun func(l1 l2)
       (if(null l1) l2
       (cons(first l1)(func (rest l1) l2))))

     OUTPUT-

       (func '(1 2 3) '(4 5 6))
       (1 2 3 4 5 6)

No comments:

Post a Comment