Re: symbold and packages

Ronald Sudomo <[email protected]> Thu, 8 Jul 2004 16:45:55 -0600
Newsgroups gmane.lisp.allegro
Message-ID <[email protected]>
Hi Fabrizio,

I'm not sure I clearly understand the problem you want to solve. So my 
answer might  totally be wrong. But it seems to me that you  should be 
able to get the result you expected  if you use keyword  symbols 
instead.

So in p1.lisp, you would have:

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

and in p2.lisp, you would have:

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


Hope it helps,

Ronald



On Jul 8, 2004, at 3:11 PM, Fabrizio Morbini wrote:

> 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.