symbold and packages

[email protected] Thu, 8 Jul 2004 15:38:26 -0700
Newsgroups gmane.lisp.allegro
Message-ID <[email protected]>
> ******file p1.lisp
> (defpackage p1)
> (defpackage p2)
> (in-package p1)
>
> (defun goo ()
>  (p2::fp2 '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*))?

Lisp is doing exactly what it is supposed to do.  What is the "problem"?

Note that I changed

>  (p2::test 'p)

to

>  (p2::fp2 'p)

above.

You pass P1::P to P2::FP2 by calling P1::GOO.
Then P2:FP2 prints P1::P, its argument (OK).
Then P2:FP2 prints P2::*TEST* (OK).
Then P2:FP2 prints (member P1::P P2::*TEST*) (which it isn't - OK).

What is wrong?

 -Bob