Google News
logo
Lisp - Interview Questions
How to Deleting a LISP Package?
The delete-package macro allows you to delete a package. The following example demonstrates this −

Example : Create a new source code file named main.lisp and type the following code in it.
(make-package :tom)
(make-package :dick)
(make-package :harry)
(in-package tom)
(defun hello ()
   (write-line "Hello! This is Tom's Free Time Learning")
)

(in-package dick)
(defun hello ()
   (write-line "Hello! This is Dick's Free Time Learning")
)

(in-package harry)
(defun hello ()
   (write-line "Hello! This is Harry's Free Time Learning")
)

(in-package tom)
(hello)
(in-package dick)
(hello)
(in-package harry)
(hello)
(delete-package tom)
(in-package tom)
(hello)​

When you execute the code, it returns the following result :
Hello! This is Tom's Free Time Learning
Hello! This is Dick's Free Time Learning
Hello! This is Harry's Free Time Learning
*** - EVAL: variable TOM has no value​
Advertisement