Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Hide the utility functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeto committed Aug 17, 2012
1 parent 6de9916 commit 9ac9506
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions fakespace.el
Expand Up @@ -44,16 +44,16 @@


;;; Code: ;;; Code:


(defun atom-list (&optional ob) (defun fakespace--atom-list (&optional ob)
"Return given obarray OB as a list. Defaults to obarray." "Return given obarray OB as a list. Defaults to obarray."
(let ((lst ())) (let ((lst ()))
(mapatoms (lambda (s) (push s lst)) ob) (mapatoms (lambda (s) (push s lst)) ob)
lst)) lst))


(defun atom-difference (a b) (defun fakespace--atom-difference (a b)
"Like set-difference, but, for performance reasons, requires "Like set-difference, but, for performance reasons, requires
specially formed lists (i.e. from `atom-list'). Returns items specially formed lists (i.e. from `fakespace--atom-list'). Returns
that are in B and not A." items that are in B and not A."
(let ((diff)) (let ((diff))
(while (and (not (null a)) (not (null b))) (while (and (not (null a)) (not (null b)))
(while (not (eq (car a) (car b))) (while (not (eq (car a) (car b)))
Expand All @@ -69,13 +69,14 @@ that are in B and not A."
(let ((type (car arg))) (let ((type (car arg)))
(cond ((eq type :exports) t) ; interning the symbols is enough (cond ((eq type :exports) t) ; interning the symbols is enough
((eq type :use) (mapcar (lambda (s) (require s)) (cdr arg)))))) ((eq type :use) (mapcar (lambda (s) (require s)) (cdr arg))))))
(setq old-obarray (atom-list)) (setq old-obarray (fakespace--atom-list))
`(provide (quote ,name))) `(provide (quote ,name)))


(defmacro end-package () (defmacro end-package ()
(cons 'progn (cons 'progn
(mapcar (lambda (s) `(unintern (quote ,s) nil)) (mapcar (lambda (s) `(unintern (quote ,s) nil))
(atom-difference old-obarray (atom-list)))))) (fakespace--atom-difference old-obarray
(fakespace--atom-list))))))


(provide 'fakespace) (provide 'fakespace)


Expand Down

0 comments on commit 9ac9506

Please sign in to comment.