Lisp HUG Maillist Archive

About common-lisp:print-actions

Hi, LispWorks

Recently, when I use a LALR parser package called Zebu, I found this:

ZEBU 14 > (compile-slr-grammar "ex1.zb")

Reading grammar from ex1.zb

Error: Using package ZEBU results in a name conflict for this symbol:
LISPWORKS:PRINT-ACTIONS.
  1 (continue) Unintern the conflicting symbol from its home package.
  2 Shadow the conflicting symbols.
  3 Shadowing-import the conflicting symbol already visible in
COMMON-LISP-USER.
  4 Shadowing-import the conflicting symbol from ZEBU.
  5 Skip using ZEBU by COMMON-LISP-USER.
  6 (abort) Return to level 0.
  7 Return to top loop level 0.

Type :b for backtrace, :c <option number> to proceed,  or :? for other
options

ZEBU 15 : 1 > :c 2

I found the symbol LISPWORKS:PRINT-ACTIONS is external in COMMON-LISP.
If someone define the same symbol, a name conflict will happen. Is this
a trivial bug? Since I think the COMMON-LISP package should have any
external symbol which doesn't appear in Common Lisp Standard.

Thanks.

Chun Tian (binghe)


Re: About common-lisp:print-actions

On Wed, 2007-06-27 at 23:15 +0800, Chun Tian (binghe) wrote:
> Hi, LispWorks
> 
> Recently, when I use a LALR parser package called Zebu, I found this:
> 
> ZEBU 14 > (compile-slr-grammar "ex1.zb")
> 
> Reading grammar from ex1.zb
> 
> Error: Using package ZEBU results in a name conflict for this symbol:
> LISPWORKS:PRINT-ACTIONS.
>   1 (continue) Unintern the conflicting symbol from its home package.
>   2 Shadow the conflicting symbols.
>   3 Shadowing-import the conflicting symbol already visible in
> COMMON-LISP-USER.
>   4 Shadowing-import the conflicting symbol from ZEBU.
>   5 Skip using ZEBU by COMMON-LISP-USER.
>   6 (abort) Return to level 0.
>   7 Return to top loop level 0.

I haven't attempted to duplicate this myself but it appears that ZEBU is
attempting to intern symbols in the COMMON-LISP-USER package (rather
than the COMMON-LISP package).

While not a bug, it is not recommended practise (I'd go as far as to
call it poor form) and I'd suggest either contacting the author and
requesting him to intern symbols into a different package (the current 
binding of *package* for example) or changing the offending code
yourself.


> I found the symbol LISPWORKS:PRINT-ACTIONS is external in COMMON-LISP.

It doesn't appear to be (external in CL or CL-USER), it is an inherited
symbol.

> If someone define the same symbol, a name conflict will happen. Is this
> a trivial bug? Since I think the COMMON-LISP package should have any
> external symbol which doesn't appear in Common Lisp Standard.

Yes, there is a restriction on what external symbols the COMMON-LISP 
package may have, but, there are no restrictions on internal-symbols,
nor the packages it may have on it's package-use-list which means that
conflicts like this can still occur in conforming programs running on 
conforming implementations.


Cheers,
 Sean.

-- 
....Please don't assume Lisp is only useful for Animation and Graphics,
AI, Bioinformatics, B2B and E-Commerce, Data Mining, EDA/Semiconductor
applications, Expert Systems, Finance, Intelligent Agents, Knowledge
Management, Mechanical CAD, Modeling and Simulation, Natural Language,
Optimization, Research, Risk Analysis, Scheduling, Telecom, and Web
Authoring just because these are the only things they happened to list.

Kent Pitman.



Re: About common-lisp:print-actions

On Thu, 2007-06-28 at 00:29 +0800, Chun Tian (binghe) wrote:
> Sean wrote:
> > On Wed, 2007-06-27 at 23:15 +0800, Chun Tian (binghe) wrote:
> >   
> >> Hi, LispWorks
> >>
> >> Recently, when I use a LALR parser package called Zebu, I found this:
> >>
> >> ZEBU 14 > (compile-slr-grammar "ex1.zb")
> >>
> >> Reading grammar from ex1.zb
> >>
> >> Error: Using package ZEBU results in a name conflict for this symbol:
> >> LISPWORKS:PRINT-ACTIONS.
> >>   1 (continue) Unintern the conflicting symbol from its home package.
> >>   2 Shadow the conflicting symbols.
> >>   3 Shadowing-import the conflicting symbol already visible in
> >> COMMON-LISP-USER.
> >>   4 Shadowing-import the conflicting symbol from ZEBU.
> >>   5 Skip using ZEBU by COMMON-LISP-USER.
> >>   6 (abort) Return to level 0.
> >>   7 Return to top loop level 0.
> >>     
> >
> > I haven't attempted to duplicate this myself but it appears that ZEBU is
> > attempting to intern symbols in the COMMON-LISP-USER package (rather
> > than the COMMON-LISP package).
> >
> > While not a bug, it is not recommended practise (I'd go as far as to
> > call it poor form) and I'd suggest either contacting the author and
> > requesting him to intern symbols into a different package (the current 
> > binding of *package* for example) or changing the offending code
> > yourself.
> >
> >   
> Thanks for the explanation.
> 
> I recheck the source code, the author just define a function named
> print-actions in ZEBU package and export it.(but no code use this
> function...)
> 
> And I cannot find that "ZEBU is attempting to intern symbols in the
> COMMON-LISP-USER package", there's no such code, I think. (You can find
> source on http://constantly.at/lisp/zebu-3.5.5-asdf.tgz)


I've taken a quick peek and the source of the problem isn't in the zebu source
code itself but in the grammar file test/ex1.zb.

the first form in the file specifies what package is going to be used 
(or whatever zebu does with it) and in this case it is CL-USER. 
I changed this package to a fresh package I created (which only uses :CL and :ZEBU)
and the grammar compilation succeeded.

Cheers, 
 Sean.



-- 
....Please don't assume Lisp is only useful for Animation and Graphics,
AI, Bioinformatics, B2B and E-Commerce, Data Mining, EDA/Semiconductor
applications, Expert Systems, Finance, Intelligent Agents, Knowledge
Management, Mechanical CAD, Modeling and Simulation, Natural Language,
Optimization, Research, Risk Analysis, Scheduling, Telecom, and Web
Authoring just because these are the only things they happened to list.

Kent Pitman.



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