title: Using the [Take New] restart in SBCL
body: <p>When I try to re-define a package in SBCL in such a way that causes name conflicts, I get a <code>NAME-CONFLICT</code> error with the restarts</p>
  
  <pre><code> 0: [KEEP-OLD] Keep symbols already accessible FOO (shadowing others).
   1: [TAKE-NEW] Make newly exposed symbols accessible in FOO, uninterning old ones.
   2: [RESOLVE-CONFLICT] Resolve conflict.
   3: [RETRY] Retry SLIME REPL evaluation request.
   4: [*ABORT] Return to SLIME's top level.
   5: [ABORT] Abort thread (#&lt;THREAD "new-repl-thread" RUNNING {10060E47B3}&gt;)
  </code></pre>
  
  <p>I'd like to write something that would automatically invoke the <code>TAKE-NEW</code> restart, so that I could do something like </p>
  
  <pre><code>(force (defpackage :foo (:use :cl :bar :baz :mumble)))
  </code></pre>
  
  <p>The result of this should be the same as calling <code>defpackage</code>, followed by manually invoking the <code>TAKE-NEW</code> restart. The problem is, </p>
  
  <pre><code>CL-USER&gt; (handler-case 
           (defpackage :foo (:use :cl :bar :baz :mumble))
         (error (e) (compute-restarts e)))
  (#&lt;RESTART SWANK::RETRY {1006DC40F3}&gt; #&lt;RESTART ABORT {10068007E3}&gt;
   #&lt;RESTART ABORT {10060C7F93}&gt;)
  CL-USER&gt; 
  </code></pre>
  
  <p>I don't seem to have access to that particular restart. As confirmed when I try to invoke it:</p>
  
  <pre><code>CL-USER&gt; (handler-case 
           (defpackage :foo (:use :cl :bar :baz :mumble))
         (name-conflict (e) (invoke-restart 'take-new)))
  
  No restart TAKE-NEW is active.
     [Condition of type SB-INT:SIMPLE-CONTROL-ERROR]
  
  Restarts:
   0: [RETRY] Retry SLIME REPL evaluation request.
   1: [*ABORT] Return to SLIME's top level.
   2: [ABORT] Abort thread (#&lt;THREAD "new-repl-thread" RUNNING {10060E47B3}&gt;)
  </code></pre>
  
  <p>Any ideas?</p>