I define a package
[10]> (defpackage :abc)
#<PACKAGE ABC>
[11]>
I use that package
[15]> (in-package :abc)
#<PACKAGE ABC>
ABC[16]>
How to exit ABC[16] to [17] ?
Thank you~
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Strictly speaking you don’t use the package with
in-packagebut youset the current package. To use a package you’ve to use
use-package.Back to your problem, you’ve defined a new package (without using
:clso you’ll have to use
(cl:+ 1 2)to do an addition) and set it asthe current package.
COMMON-LISP-USERa.k.a.CL-USERis thecurrent package when you start your lisp system, thus to have it back
you just have to do
(cl:in-package :cl-user).Here is a nice tutorial on packages in Common Lisp. This chapter
in PCL is also very good. But the reference is still the CLHS