Name clash with EXT::EXECUTE

Discussion of Common Lisp

Name clash with EXT::EXECUTE

Postby nagle » Fri Aug 05, 2016 1:12 pm

I'm reviving the classic Boyer-Moore theorem prover, "nqthm", from the 1992 sources. It almost works with "clisp", but there's a name clash.

Following directions from, I get the following error:
Code: Select all
;; Loading file /home/john/projects/nqthm/nqthm-1992/sloop.fas ...
;; Loading file /home/john/projects/nqthm/nqthm-1992/code-e-m.fas ...
** - Continuable Error
If you continue (by typing 'continue'): Ignore the lock and proceed
The following restarts are also available:
SKIP           :R1      skip 675 683 (DEFUN EXECUTE (PROCESS CL HIST ...) ...)-25
RETRY          :R2      retry 675 683 (DEFUN EXECUTE (PROCESS CL HIST ...) ...)-25
STOP           :R3      stop loading file /home/john/projects/nqthm/nqthm-1992/code-e-m.fas
ABORT          :R4      Abort main loop
Break 1 [6]>
If I type "continue" at this point, the program runs, with EXT::EXECUTE having been overridden.

The problem is in the source file which, at line 675, has


This file starts with (IN-PACKAGE "USER"), so EXECUTE should be defined as USER::EXECUTE. Despite this, there's a name clash, apparently because the EXT package exports all of its exported symbols into the current namespace, and locks its own package, making its exported symbols de-facto reserved words.

There's a comment in the code:
Code: Select all
;  Sadly, we do everything in the USER package.  This is not the best
;  Lisp style for an old and established Common Lisp system, but it is
;  by far the simplest and clearest approach we could find given the
;  variety of implementations of Common Lisp's "Put in seven extremely
;  random user interface commands".  If your USER package contains
;  symbols that conflict with ours, we apologize but offer no fix.

I could go into the source code and rename all occurrences of EXECUTE to something else, such as EXECUTE-PROCESS; there are only about 8 occurrences. But I'd prefer not to modify the classic source code, untouched since 1992. Is there a better way to do this?
Posts: 2
Joined: Wed Aug 03, 2016 3:37 pm

Re: Name clash with EXT::EXECUTE

Postby pjstirling » Tue Aug 09, 2016 2:12 pm

The problem appears to be, on clisp:

Code: Select all
[1]> (find-package "USER")

COMMON-LISP-USER is explicitly allowed to include whatever implementation-specific symbols (that don't conflict with those of COMMON-LISP) that the implementation likes, for clisp that includes the symbols from EXT, which unhappily for this case, includes EXT:EXECUTE.

I've not investigated your theorem prover's code, but by using an implementation package and not defining its own is indeed the cause of the problem, as that comment states, but the comment also implies that the author had no real understanding of how to write portable code that could selectively call implementation specific behaviour (d'oh!)

I think some kind of source surgery is necessary, though probably creating a proper package is the right change rather than simply renaming the EXECUTE function (though potentially a little more work).
Posts: 149
Joined: Sun Nov 28, 2010 4:21 pm

Return to Common Lisp

Who is online

Users browsing this forum: No registered users and 2 guests