symbold and packages

Fabrizio Morbini <[email protected]> Thu, 8 Jul 2004 17:11:29 -0400 (EDT)
Newsgroups gmane.lisp.allegro
Message-ID <[email protected]>
Hi All, I have the following problem:

-two lisp files, one is in package p1 and the other in package p2. -from
package user I call (p1::goo). Inside p1::goo it is called a function
defined in p2 with one argument (lets call this function in p2: fp2).
-inside fp2 I compare the argument of the function (with the function
member) with a global variable defined (with defparameter) in p2.

To make the thing more clear this is an example:

******file p1.lisp
(defpackage p1)
(defpackage p2)
(in-package p1)

(defun goo ()
 (p2::test 'p)
 )

******file p2.lisp
(in-package p2)

(defparameter *test* '(p q r))

(defun fp2 (x)
 (print x)
 (print *test*)
 (print (member x *test*))
 )

What I get is:

CL-USER(1): :ld p1.lisp
; Loading p1.lisp
CL-USER(2): :ld p2.lisp
; Loading p2.lisp
CL-USER(3): (p1::goo)

P1::P
(P2::P P2::Q P2::R)
NIL

--------------

Is there a better way to solve the problem instead of using
(read-from-string (format nil "~a" *test*))?

Thanks, Fabrizio.