Lisp HUG Maillist Archive

Defining macro FOO visible from BAR

Hello all,
I'm getting an error involving macros, package visibility and 
'.' in names.

Three files have I:

test1.lisp:
(make-package :match)


test2.lisp
(in-package :match)
(export '(new.set))


test.3:lisp
(in-package :match)
(defmacro new.set ()
    `( () ))


In a listener, I run

(mapcar #'load '("test1" "test2" "test3"))

and I get the error:
Defining macro New.Set visible from package MATCH

I do not get this error if rather than new.set I just use newset (with
no period)


This is the second issue I've had recently in 4.4 with . in names. The first
was not being able to load files from the editor like "test.foo.lisp". Is this
related, perhaps? Either way, this one seems like it would be harder to 
work around. Any ideas?

 



-- 
=====================
Joshua Taylor
tayloj@rpi.edu


Re: Defining macro FOO visible from BAR

Unable to parse email body. Email id is 3544

Re: Defining macro FOO visible from BAR

> I think you would get that error if NEWSET was exported in the MATCH
> package.

My mistake, I do get that error. 

> Use a package name which is less likely to clash. For example, you
> could embed your project name in the package name.

Well, unfortunately it's not my code, but the SNePS system from
SUN Y Buffalo. At the moment I just turn off warning on redefinition
for the time that I load the code defining things. I guess I'll have to 
go into some package renaming later on...


-- 
=====================
Joshua Taylor
tayloj@rpi.edu


Re: Defining macro FOO visible from BAR

Unable to parse email body. Email id is 3546

Re: Defining macro FOO visible from BAR

At 15/02/2005 12:53, davef@lispworks.com wrote:

>  > > Use a package name which is less likely to clash. For example, you
>  > > could embed your project name in the package name.
>  >
>  > Well, unfortunately it's not my code, but the SNePS system from
>  > SUN Y Buffalo. At the moment I just turn off warning on redefinition
>  > for the time that I load the code defining things. I guess I'll have to
>  > go into some package renaming later on...
>
>In this case a safer approach (that is, safer than switching off all
>redefinition checks) would be to remove checking on the MATCH package
>only:
>
>(SETF *PACKAGES-FOR-WARN-ON-REDEFINITION*
>       (DELETE "MATCH" *PACKAGES-FOR-WARN-ON-REDEFINITION*
>               :TEST 'STRING=))

BTW, why is the keyword package in this list? I use to define 
functions in this package (for exemple a :test function) and have 
just defined these 2 macros a few days ago:

(eval-when (:compile-toplevel :load-toplevel :execute)
   (defmacro without-redefinition-warnings (&body body)
     `(let ((*redefinition-action* nil))
        ,@body)))

(defmacro without-protection-errors (&body body)
   `(let ((*packages-for-warn-on-redefinition* nil))
       (without-redefinition-warnings
        ,@body)))


Francis


>The LispWorks MATCH package is used only by Common SQL.
>
>__
>Dave Fox
>LispWorks Ltd
>St John's Innovation Centre
>Cowley Road
>Cambridge
>CB4 0WS
>England
>
>+44 1223 421861


Re: Defining macro FOO visible from BAR

Unable to parse email body. Email id is 3548

Updated at: 2020-12-10 08:53 UTC