Permalink
Browse files

Tidy up a bit.

  • Loading branch information...
1 parent 09e4043 commit 46ff423deb66dd876ffdc0048a3517d138fdd281 @skeeto committed May 26, 2011
Showing with 13 additions and 15 deletions.
  1. +13 −15 fakespace.el
View
@@ -26,20 +26,18 @@ specially formed lists. Returns items that are in B and not A."
(setq b (cdr b)))
diff))
-(defvar old-obarray ()
- "List of all the items from obarray at some previous time.")
-
-(defmacro defpackage (name &rest args)
- (dolist (arg args)
- (let ((type (car arg)))
- (cond ((eq type :exports) t) ; interning the symbols is enough
- ((eq type :use) (mapcar (lambda (s) (require s)) (cdr arg))))))
- (setq old-obarray (atom-list))
- `(provide (quote ,name)))
-
-(defmacro end-package ()
- (cons 'progn
- (mapcar (lambda (s) `(unintern (quote ,s)))
- (atom-difference old-obarray (atom-list)))))
+(lexical-let ((old-obarray ()))
+ (defmacro defpackage (name &rest args)
+ (dolist (arg args)
+ (let ((type (car arg)))
+ (cond ((eq type :exports) t) ; interning the symbols is enough
+ ((eq type :use) (mapcar (lambda (s) (require s)) (cdr arg))))))
+ (setq old-obarray (atom-list))
+ `(provide (quote ,name)))
+
+ (defmacro end-package ()
+ (cons 'progn
+ (mapcar (lambda (s) `(unintern (quote ,s) nil))
+ (atom-difference old-obarray (atom-list))))))
(provide 'fakespace)

0 comments on commit 46ff423

Please sign in to comment.