Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exit the package that I'm just using in common lisp?

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~

like image 992
sam Avatar asked Oct 14 '25 03:10

sam


1 Answers

Strictly speaking you don't use the package with in-package but you set 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 :cl so you'll have to use (cl:+ 1 2) to do an addition) and set it as the current package. COMMON-LISP-USER a.k.a. CL-USER is the current 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

like image 98
Daimrod Avatar answered Oct 16 '25 20:10

Daimrod



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!