[Openmcl-devel] symbols equality
Taoufik Dachraoui
dachraoui.taoufik at gmail.com
Sat Jan 5 03:17:55 PST 2013
Hi
I am developing a simple package system and stumbled in the issue described
below:
Very rudimentary description (by example) of the simple package system:
Files:
/root
foo.lisp
bar.lisp
tools/
upcase.lisp
File foo.lisp <<
@::use (common-lisp bar tools/upcase)
;; everything after this point and before the next @::public is not exported
....
@::public
;; everything after this point is exported (external)
(defun foofun (a) ...)
>> end file
File bar.lisp <<
@::use (common-lisp tools/upcase)
;;; private section
(defun ....) ....
@::public
;; public section
(defun barfun (a) ...)
>> end file
File upcase.lisp <<
@::use (common-lisp)
;;; private section
....
@::public
;;; public section
....
>> end file
Now from ccl
? (mb:use 'foo)
;; this will create a package "/ROOT/FOO.LISP" with nickname "FOO"
;; along all packages (files) used by foo (/ROOT/BAR.LISP,
;; /ROOT/TOOLS/UPCASE.LISP) in @::use instruction
All created packages has a symbol **MB-PACKAGE-TIMESTAMP** that is equal to
the creation time of the package
Now, the issue (or annoyance) I encountered is the following:
(make-package :test1 :use :common-lisp)
(make-package :test2 :use :common-lisp)
(in-package :test2)
(defun foo (e) (if (eq e 'azerty) 'ok))
(export 'foo)
(in-package :test1)
(use-package :test2)
? (foo 'test2::azerty)
TEST2::OK
? (foo 'azerty)
NIL
?
I understand that this is how it should be.
But this poses an issue for me, because I have to use
(string= (symbol-name e) "AZERTY") in foo:
(defun foo (e) (if (string= (symbol-name e) "AZERTY") 'ok))
But then the 'ok will be returned as TEST2::OK, this means that TEST1
package has to use symbol-name and intern it
This is annoying, how do you solve this issue
Thanks for your help
Taoufik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20130105/052a6e7a/attachment.htm>
More information about the Openmcl-devel
mailing list